GetPatch returns the changes between the two SHAs as a patch string.
(ctx context.Context, from, to SHA)
| 23 | |
| 24 | // GetPatch returns the changes between the two SHAs as a patch string. |
| 25 | func (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. |