aboutsummaryrefslogtreecommitdiff
path: root/http_handle_repo_contrib_one.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-03-05 10:05:04 +0800
committerRunxi Yu <me@runxiyu.org>2025-03-05 10:05:04 +0800
commit80492711b4588c10dffa93a57fd9926dc337bbae (patch)
tree93b6240452b0c274d2f50cb396ae8e441b3ff6ea /http_handle_repo_contrib_one.go
parent*: Replacing more := with var (diff)
downloadforge-80492711b4588c10dffa93a57fd9926dc337bbae.tar.gz
forge-80492711b4588c10dffa93a57fd9926dc337bbae.tar.zst
forge-80492711b4588c10dffa93a57fd9926dc337bbae.zip
*: Typing fixes
Diffstat (limited to 'http_handle_repo_contrib_one.go')
-rw-r--r--http_handle_repo_contrib_one.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/http_handle_repo_contrib_one.go b/http_handle_repo_contrib_one.go
index 91acfea..9810d5d 100644
--- a/http_handle_repo_contrib_one.go
+++ b/http_handle_repo_contrib_one.go
@@ -55,11 +55,12 @@ func handle_repo_contrib_one(w http.ResponseWriter, r *http.Request, params map[
destination_branch_hash, err = get_ref_hash_from_type_and_name(repo, "", "")
} else {
destination_branch_hash, err = get_ref_hash_from_type_and_name(repo, "branch", destination_branch)
- if err != nil {
- http.Error(w, "Error getting destination branch hash: "+err.Error(), http.StatusInternalServerError)
- return
- }
}
+ if err != nil {
+ http.Error(w, "Error getting destination branch hash: "+err.Error(), http.StatusInternalServerError)
+ return
+ }
+
destination_commit, err := repo.CommitObject(destination_branch_hash)
if err != nil {
http.Error(w, "Error getting destination commit: "+err.Error(), http.StatusInternalServerError)