Git.vala
[gitlive] / Git.vala
index 1124fda..0fc4754 100644 (file)
--- a/Git.vala
+++ b/Git.vala
@@ -93,10 +93,13 @@ namespace  GitLive {
                }
                Ggit.Branch? getBranch(string remote_name, string remote_branch_name)
                {
-                        GLib.debug("lookup %s:%s", remote_name, remote_branch_name);
+
+                        var target = remote_branch_name.replace("refs/heads/", remote_name+"/");
+
+                        
                        foreach(var br in this.branches) {
-                               GLib.debug("test:%s=%s", "refs/remotes/" +  br.get_upstream().get_shorthand() , remote_branch_name);
-                               if ("refs/remotes/" +  br.get_upstream().get_shorthand() == remote_branch_name) {
+                               GLib.debug("test:%s=%s", br.get_upstream().get_shorthand() , target);
+                               if ( br.get_upstream().get_shorthand() == target) {
                                        return br;
                                }
                                
@@ -128,7 +131,7 @@ namespace  GitLive {
                                
                                var heads = r.list();
                                foreach(var rh in heads) {
-                                       var br = this.getBranch(n, rh.get_shorthand());
+                                       var br = this.getBranch(n, rh.get_name());
                                
                                        GLib.debug("got heads: name=%s   rev=%s  localrev=%s",
                                                rh.get_name(),