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

index 6291e8d..5776ab6 100644 (file)
@@ -92,8 +92,15 @@ public class GitBranch : Object
                        br.active = gbr.is_head();
                        br.name = gbr.get_name();
                        br.lastrev = gbr.get_target().to_string();
-                       var rname = br.get_upstream().get_name();
-                       
+                       var rname = br.get_upstream() ? br.get_upstream().get_name() : "";
+                       if (rname.has_prefix("refs/remotes/origin/")) {
+                               rname = rname.substring(20);
+                               if (remotes.has_key(rname)) {
+                                       br.remote = rname;
+                                       br.remoterev = remotes.get(rname);
+                               }
+                               // age?
+                       }
                        
                }