MCPcopy Create free account
hub / github.com/alibaba/open-code-review / computeMergeBase

Method computeMergeBase

internal/diff/git.go:259–265  ·  view source on GitHub ↗

---- Internal helpers ----

(ctx context.Context, from, to string)

Source from the content-addressed store, hash-verified

257// ---- Internal helpers ----
258
259func (p *Provider) computeMergeBase(ctx context.Context, from, to string) string {
260 out, err := p.runGit(ctx, "merge-base", "--end-of-options", from, to)
261 if err != nil {
262 return ""
263 }
264 return strings.TrimSpace(out)
265}
266
267func (p *Provider) workspaceTrackedDiff(ctx context.Context) (string, error) {
268 out, err := p.runGit(ctx, "-c", "core.quotepath=false", "diff", "--no-ext-diff", "--no-textconv", "--find-renames", "--src-prefix=a/", "--dst-prefix=b/", "--no-color", "-U"+fmt.Sprint(DiffContextLines), "--end-of-options", "HEAD", "--")

Callers 1

MergeBaseMethod · 0.95

Calls 1

runGitMethod · 0.95

Tested by

no test coverage detected