Git.vala
[gitlive] / Git.vala
index af4208c..f4ec391 100644 (file)
--- a/Git.vala
+++ b/Git.vala
@@ -91,16 +91,20 @@ namespace  GitLive {
                        
                
                }
-               Ggit.Branch? getBranch(string remote_name)
+               Ggit.Branch? getBranch(string remote_name, string remote_branch_name)
                {
-                       GLib.debug("lookup %s", remote_name);
+
+                        var target = remote_branch_name.replace("refs/heads/", remote_name+"/") .replace("refs/remotes/", "");
+
+                        
                        foreach(var br in this.branches) {
-                               if (br.get_upstream().get_short_name() == remote_name) {
+                       //      GLib.debug("test:%s=%s", br.get_upstream().get_shorthand() , target);
+                               if ( br.get_upstream().get_shorthand() == target) {
                                        return br;
                                }
                                
                        }
-                       GLib.debug("missing %s", remote_name);                  
+                       //GLib.debug("missing %s", remote_branch_name);                 
                        return null;
                
                }
@@ -127,7 +131,7 @@ namespace  GitLive {
                                
                                var heads = r.list();
                                foreach(var rh in heads) {
-                                       var br = this.getBranch(rh.get_name());
+                                       var br = this.getBranch(n, rh.get_name());
                                
                                        GLib.debug("got heads: name=%s   rev=%s  localrev=%s",
                                                rh.get_name(),