MCPcopy Create free account
hub / github.com/MiniCodeMonkey/chief / getMergeBase

Function getMergeBase

internal/git/git.go:167–175  ·  view source on GitHub ↗

getMergeBase returns the merge base commit between two refs.

(dir, ref1, ref2 string)

Source from the content-addressed store, hash-verified

165
166// getMergeBase returns the merge base commit between two refs.
167func getMergeBase(dir, ref1, ref2 string) (string, error) {
168 cmd := exec.Command("git", "merge-base", ref1, ref2)
169 cmd.Dir = dir
170 output, err := cmd.Output()
171 if err != nil {
172 return "", err
173 }
174 return strings.TrimSpace(string(output)), nil
175}
176
177// getDiffOutput returns the full diff between two refs.
178func getDiffOutput(dir, from, to string) (string, error) {

Callers 2

GetDiffFunction · 0.85
GetDiffStatsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected