diff options
Diffstat (limited to 'http_handle_repo_contrib_one.go')
-rw-r--r-- | http_handle_repo_contrib_one.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/http_handle_repo_contrib_one.go b/http_handle_repo_contrib_one.go index 9810d5d..7ed0d6f 100644 --- a/http_handle_repo_contrib_one.go +++ b/http_handle_repo_contrib_one.go @@ -68,7 +68,15 @@ func handle_repo_contrib_one(w http.ResponseWriter, r *http.Request, params map[ } params["destination_commit"] = destination_commit - patch, err := destination_commit.Patch(source_commit) + merge_bases, err := source_commit.MergeBase(destination_commit) + if err != nil { + http.Error(w, "Error getting merge base: "+err.Error(), http.StatusInternalServerError) + return + } + merge_base := merge_bases[0] + params["merge_base"] = merge_base + + patch, err := merge_base.Patch(source_commit) if err != nil { http.Error(w, "Error getting patch: "+err.Error(), http.StatusInternalServerError) return |