diff options
| author | Jeff Carr <[email protected]> | 2025-01-29 20:01:07 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-01-29 20:01:07 -0600 |
| commit | b57144e6bfe8a6b63d2d2f8ffb47af04a926ae8b (patch) | |
| tree | 4f9823561ff5a44616e51cdd63f2d077149f7918 /shell.go | |
| parent | 19fb3a29fb6c5f157d78696c211d159d3748911a (diff) | |
some useful helper functions
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) +} |
