GitBranch.vala
authorAlan Knowles <alan@roojs.com>
Wed, 20 Mar 2019 07:16:19 +0000 (15:16 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 20 Mar 2019 07:16:19 +0000 (15:16 +0800)
GitBranch.vala

index 7e81038..5ab6901 100644 (file)
@@ -75,8 +75,13 @@ public class GitBranch : Object
                var cb = new GitCallbacks(repo);
                rem.connect(Ggit.Direction.FETCH, cb, null, null);
                var remote_heads = rem.list();
-       
-         
+               foreach(var rh in remote_heads) {
+                       var rn = rh.get_name();
+                       if (!rn.has_prefix("refs/heads/")) {
+                               continue;
+                       }
+                       remotes.set(rn.substr(12), rh.get_oid().to_string());
+         }
                
                 
                var r = repo.repo.enumerate_branches(Ggit.BranchType.LOCAL);