summaryrefslogtreecommitdiffstats
path: root/modules/git/repo_compare.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/git/repo_compare.go')
-rw-r--r--modules/git/repo_compare.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/git/repo_compare.go b/modules/git/repo_compare.go
index 53b8af4bb4..683ac7a7ee 100644
--- a/modules/git/repo_compare.go
+++ b/modules/git/repo_compare.go
@@ -112,3 +112,9 @@ func (repo *Repository) GetPatch(base, head string, w io.Writer) error {
return NewCommand("format-patch", "--binary", "--stdout", base+"..."+head).
RunInDirPipeline(repo.Path, w, nil)
}
+
+// GetDiffFromMergeBase generates and return patch data from merge base to head
+func (repo *Repository) GetDiffFromMergeBase(base, head string, w io.Writer) error {
+ return NewCommand("diff", "-p", "--binary", base+"..."+head).
+ RunInDirPipeline(repo.Path, w, nil)
+}