From 94f1d8f296b079dfade7a818a516d400860890bd Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Tue, 30 Oct 2018 16:58:58 +0800 Subject: [PATCH] sync --- GitRepo.vala | 18 ++++++++++++++++++ config1.builder | 4 +++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/GitRepo.vala b/GitRepo.vala index 3602e7f0..989a32b5 100644 --- a/GitRepo.vala +++ b/GitRepo.vala @@ -152,6 +152,8 @@ public class GitRepo : Object public void loadBranches() { + this.branches = new Gee.HashMap(); + string[] cmd = { "branch", "--no-color", "--verbose", "--no-abbrev" , "-a" }; var res = this.git( cmd ); var lines = res.split("\n"); @@ -160,12 +162,28 @@ public class GitRepo : Object if (!br.parseBranchListItem(lines[i])) { continue; } + GLib.debug("add branch %s", br.realName()); + branches.set(br.realName(), br); if (br.active) { this.currentBranch = br; } } + } + public string branchesToString() + { + var ret = ""; + foreach( var br in this.branches.values) { + if (br.name == "") { + continue; + } + ret += ret.length > 0 ? "," : ""; + ret += br.name; + + } + return ret; + } /** diff --git a/config1.builder b/config1.builder index 83f17f7d..0362cd27 100644 --- a/config1.builder +++ b/config1.builder @@ -13,7 +13,9 @@ "..//gitlive/StatusIcon.vala", "..//gitlive/WindowLog.vala", "..//gitlive", - "..//gitlive/Clones.vala" + "..//gitlive/Clones.vala", + "..//gitlive/GitBranch.vala", + "..//gitlive/NewBranch.vala" ], "packages" : [ ] -- 2.39.2