aboutsummaryrefslogtreecommitdiff
path: root/http_handle_repo_contrib_one.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-02-19 15:36:24 +0800
committerRunxi Yu <me@runxiyu.org>2025-02-19 15:36:24 +0800
commitcb66c0137b291984dfbbac480c66db8f30b97964 (patch)
treea7f61b8978f155f7485933367f8795e34db89ad1 /http_handle_repo_contrib_one.go
parenthooks: Add TODOs on where to create MRs and MR history points (diff)
downloadforge-cb66c0137b291984dfbbac480c66db8f30b97964.tar.gz
forge-cb66c0137b291984dfbbac480c66db8f30b97964.tar.zst
forge-cb66c0137b291984dfbbac480c66db8f30b97964.zip
repo/contrib/one: Add missing error check
Diffstat (limited to 'http_handle_repo_contrib_one.go')
-rw-r--r--http_handle_repo_contrib_one.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/http_handle_repo_contrib_one.go b/http_handle_repo_contrib_one.go
index 42edd8c..6841f2b 100644
--- a/http_handle_repo_contrib_one.go
+++ b/http_handle_repo_contrib_one.go
@@ -50,6 +50,10 @@ 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)
+ if err != nil {
+ http.Error(w, "Error getting patch: "+err.Error(), http.StatusInternalServerError)
+ return
+ }
params["file_patches"] = make_usable_file_patches(patch)
render_template(w, "repo_contrib_one", params)