X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=GitRepo.vala;h=77a56f2fcf5bd1111ff05857a0cd00e94453c0f4;hb=beb0b87544a81660c3e886c1130306bb54efb2cd;hp=17556aedcb3e906d27d30f25d51ba8969c2eb529;hpb=f93028e569039b48af6351e2d37f80d15d94ff5a;p=gitlive diff --git a/GitRepo.vala b/GitRepo.vala index 17556aed..77a56f2f 100644 --- a/GitRepo.vala +++ b/GitRepo.vala @@ -266,6 +266,7 @@ public class GitRepo : Object this.git( cmd ); cmd = { "commit", "--m", commit_message }; this.git( cmd ); + this.push(); this.loadBranches(); // updates lastrev.. var notification = new Notify.Notification( @@ -349,13 +350,13 @@ public class GitRepo : Object public bool createBranchNamed(string branchname) { - + var stash = false; if (this.branches.has_key(branchname)) { // this is where it get's tricky... try { string[] cmd = { "ls-files" , "-m" }; // list the modified files.. var ret = this.git(cmd); - var stash = ret.length> 1 ; + stash = ret.length> 1 ; cmd = { "stash" }; @@ -369,13 +370,13 @@ public class GitRepo : Object } try { - cmd = { "merge", "master" }; + string[] cmd = { "merge", "master" }; this.git(cmd); } catch(Error e) { try { - cmd = { "mergetool" }; + string[] cmd = { "mergetool" }; this.git(cmd); - cmd = { "commit" "-m" "Fix merge conflicts from master" }; + cmd = { "commit", "-m" , "Fix merge conflicts from master" }; this.git(cmd); } catch(Error ee) { GitMonitor.gitmonitor.pauseError(ee.message); @@ -383,19 +384,21 @@ public class GitRepo : Object } } try { - cmd = { "stash", "pop" }; + string[] cmd = { "stash", "pop" }; if (stash) { this.git(cmd); } } catch(Error ee) { GitMonitor.gitmonitor.pauseError(ee.message); return false; } - + this.push(); } else { try { string[] cmd = { "checkout", "-b" , branchname }; this.git(cmd); + + this.push(); } catch(Error ee) { GitMonitor.gitmonitor.pauseError(ee.message); return false; @@ -413,11 +416,7 @@ public class GitRepo : Object notification.show(); - } catch(Error e) { - GitMonitor.gitmonitor.pauseError(e.message); - return false; - } this.loadBranches(); // update branch list... GitMonitor.gitmonitor.runQueue(); // commit any outstanding... return true; @@ -583,7 +582,7 @@ public class GitRepo : Object public string push () throws Error, SpawnError { // should - return this.git({ "push", "origin", "HEAD" }); + return this.git({ "push", "--all" }); }