From: Alan Knowles Date: Tue, 30 Oct 2018 07:21:45 +0000 (+0800) Subject: GitBranch.vala X-Git-Url: http://git.roojs.org/?p=gitlive;a=commitdiff_plain;h=55d02b14bf37c48c2094d55283b948b6b23f0054 GitBranch.vala --- diff --git a/GitBranch.vala b/GitBranch.vala index 755968ea..d877551f 100644 --- a/GitBranch.vala +++ b/GitBranch.vala @@ -8,10 +8,10 @@ public class GitBranch : Object public GitRepo repo; public bool active = false; - public string lastrev; - public string name; - public string remote: - public string remoterev; + public string lastrev = ""; + public string name = ""; + public string remote = "": + public string remoterev = ""; public GitBranch(GitRepo repo) { @@ -26,8 +26,16 @@ public class GitBranch : Object this.active = str[0] == '*'; var bits = Regex.split_simple ("[ \t]+", str.substring(2).strip()); - + if (bits[1] == "->") { // it's an alias.. eg. remotes/origin/HEAD -> origin/master.. + return false; + } + this.lastrev = parts[1]; + if (parts[0].has_prefix("remotes/")) { + this.remote = parts[0]; + } else { + this.name = "" + } \ No newline at end of file