sync
[gitlive] / GitRepo.vala
index 9e19695..7ec4f41 100644 (file)
@@ -179,6 +179,11 @@ public class GitRepo : Object
     {
        return !FileUtils.test(this.gitdir + "/.gitlive-disable-autocommit" , FileTest.EXISTS);
     }
+    
+    public bool is_auto_branch ()
+    {
+       return FileUtils.test(this.gitdir + "/.gitlive-enable-auto-branch" , FileTest.EXISTS);
+    }
     public bool is_autopush ()
     {
        return !FileUtils.test(this.gitdir + "/.gitlive-disable-autopush" , FileTest.EXISTS);
@@ -247,9 +252,7 @@ public class GitRepo : Object
        }
        GitMonitor.gitmonitor.start();
     }
-    
-
-
+     
 
     public bool doMerge(string action, string ticket_id, string commit_message)
     {
@@ -258,13 +261,12 @@ public class GitRepo : Object
                   var ret = "";
                   if (action == "CLOSE" || action == "LEAVE") {
                                   
                try {
-                       var oldbranch = this.currentBranch.name;
-                       this.setActiveTicket(null, "master");
+                   var oldbranch = this.currentBranch.name;
+                   this.setActiveTicket(null, "master");
                string [] cmd = { "merge",   "--squash",  oldbranch };
                this.git( cmd );
-                cmd = { "commit",   "--m",  commit_message };
+                cmd = { "commit",   "-a" , "-m",  commit_message };
                this.git( cmd );
                this.push();
                this.loadBranches(); // updates lastrev..
@@ -367,11 +369,16 @@ public class GitRepo : Object
                                  } catch(Error e) {
                                                GitMonitor.gitmonitor.pauseError(e.message);
                                                return false;           
-                               
                                  }
                                  try {
-                                      string[] cmd = { "merge", "master"  };
-                                           this.git(cmd);
+                                          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);