summaryrefslogtreecommitdiff
path: root/shell.go
diff options
context:
space:
mode:
Diffstat (limited to 'shell.go')
-rw-r--r--shell.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/shell.go b/shell.go
index d14960d..c8131f6 100644
--- a/shell.go
+++ b/shell.go
@@ -193,3 +193,14 @@ func (repo *Repo) ConstructGitDiffLog(branch1, branch2 string) []string {
cmd = append(cmd, branch2)
return cmd
}
+
+// count all objects only in branch1
+func (repo *Repo) CountDiffObjects(branch1, branch2 string) int {
+ cmd := repo.ConstructGitDiffLog(branch1, branch2)
+ r, err := repo.RunVerboseOnError(cmd)
+ if err != nil {
+ return -1
+ }
+ // log.Info("countDiffObjects()", cmd, len(r.Stdout), strings.Join(r.Stdout, " "))
+ return len(r.Stdout)
+}