MCPcopy Create free account
hub / github.com/google/gapid / GetPatch

Method GetPatch

core/git/patch.go:25–31  ·  view source on GitHub ↗

GetPatch returns the changes between the two SHAs as a patch string.

(ctx context.Context, from, to SHA)

Source from the content-addressed store, hash-verified

23
24// GetPatch returns the changes between the two SHAs as a patch string.
25func (g Git) GetPatch(ctx context.Context, from, to SHA) (string, error) {
26 str, _, err := g.run(ctx, "format-patch", "--stdout", fmt.Sprintf("%v..%v", from, to))
27 if err != nil {
28 return "", err
29 }
30 return str, nil
31}
32
33// CanApplyPatch returns true if the specified patch can be applied to HEAD
34// without conficts.

Callers

nothing calls this directly

Calls 1

runMethod · 0.95

Tested by

no test coverage detected