+ // this is where it get's tricky...
+ try {
+ string[] cmd = { "ls-files" , "-m" }; // list the modified files..
+ var ret = this.git(cmd);
+ stash = ret.length> 1 ;
+
+
+ cmd = { "stash" };
+ if (stash) { this.git(cmd); }
+
+ cmd = { "checkout", branchname };
+ this.git(cmd);
+ } catch(Error e) {
+ GitMonitor.gitmonitor.pauseError(e.message);
+ return false;
+ }
+ try {
+ if (branchname != "master") {
+ string[] cmd = { "merge", "master" };
+ this.git(cmd);
+ this.push();
+ //cmd = { "commit", "-a" , "-m", "merge master changes" };
+ //git chethis.git( cmd );
+ }
+
+ } catch(Error e) {
+ string[] cmd = { "checkout", "master" };
+ this.git(cmd);
+ GitMonitor.gitmonitor.pauseError(
+ "Use\n\na) git checkout %s\nb) git mergetool\nc) git commit\nd) git push\n d) stash pop \ne) start gitlive again\n".printf(
+ branchname)
+ + e.message
+ );
+ return false;
+
+ }
+ try {
+ string[] cmd = { "stash", "pop" };
+ if (stash) { this.git(cmd); }
+ } catch(Error ee) {
+ GitMonitor.gitmonitor.pauseError(ee.message);
+ return false;
+ }
+ this.push();
+