getMergeBase returns the merge base commit between two refs.
(dir, ref1, ref2 string)
| 165 | |
| 166 | // getMergeBase returns the merge base commit between two refs. |
| 167 | func 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. |
| 178 | func getDiffOutput(dir, from, to string) (string, error) { |
no outgoing calls
no test coverage detected