/** represent a git branch.. */ public class GitBranch : Object { public GitRepo repo; public bool active = false; public string lastrev = ""; public string name = ""; public string remote = "": public string remoterev = ""; public GitBranch(GitRepo repo) { this.repo = repo; } public bool parseBranchListItem(str) { if (!str.length) { return false; } 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 = parts[0]; } }