sync
authorAlan Knowles <alan@roojs.com>
Tue, 30 Oct 2018 08:58:58 +0000 (16:58 +0800)
committerAlan Knowles <alan@roojs.com>
Tue, 30 Oct 2018 08:58:58 +0000 (16:58 +0800)
GitRepo.vala
config1.builder

index 3602e7f..989a32b 100644 (file)
@@ -152,6 +152,8 @@ public class GitRepo : Object
     
     public void loadBranches()
     {
+       this.branches = new Gee.HashMap<string,GitBranch>();
+       
        string[] cmd = { "branch",   "--no-color", "--verbose", "--no-abbrev" , "-a"  };
         var res = this.git( cmd );
         var lines = res.split("\n");
@@ -160,12 +162,28 @@ public class GitRepo : Object
                if (!br.parseBranchListItem(lines[i])) {
                        continue;
                }
+               GLib.debug("add branch %s", br.realName());
+                
                branches.set(br.realName(), br);
                if (br.active) {
                        this.currentBranch = br;
                }
         }
     
+    }
+    public string branchesToString()
+    {
+       var ret = "";
+               foreach( var br in this.branches.values) {
+                       if (br.name == "") {
+                               continue; 
+                       }
+                       ret += ret.length > 0 ? ","  : "";
+                       ret += br.name;
+               
+               }
+               return ret;
+       
     }
     
     /**
index 83f17f7..0362cd2 100644 (file)
@@ -13,7 +13,9 @@
             "..//gitlive/StatusIcon.vala",
             "..//gitlive/WindowLog.vala",
             "..//gitlive",
-            "..//gitlive/Clones.vala"
+            "..//gitlive/Clones.vala",
+            "..//gitlive/GitBranch.vala",
+            "..//gitlive/NewBranch.vala"
         ],
         "packages" : [
         ]