diff options
Diffstat (limited to 'shell.go')
| -rw-r--r-- | shell.go | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -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) +} |
