GitBranch.vala
authorAlan Knowles <alan@roojs.com>
Wed, 14 Nov 2018 08:34:35 +0000 (16:34 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 14 Nov 2018 08:34:35 +0000 (16:34 +0800)
GitBranch.vala

index 0015aef..a848a55 100644 (file)
@@ -32,6 +32,7 @@ public class GitBranch : Object
        public bool active = false;
        public string lastrev = "";
        public string name = "";
+       public bool is_remote;
        public string remote = "";
        public string remoterev = "";
        
@@ -103,9 +104,10 @@ public class GitBranch : Object
                if (parts[1] == "->") { // it's an alias.. eg. remotes/origin/HEAD -> origin/master..
                        return false;
                }
-               
+               this.is_remote = false;
                this.lastrev = parts[1];
                if (parts[0].has_prefix("remotes/")) {
+                       this.is_remote  = true;
                        this.remote = parts[0];
                } else {
                        this.name = parts[0];
@@ -114,7 +116,7 @@ public class GitBranch : Object
        }
        public string  realName()
        {
-               return this.name == "" ? this.remote : this.name;
+               return this.is_remote ? this.remote : this.name;
        }
        
        public void create()