aboutsummaryrefslogtreecommitdiff
path: root/handle_repo_commit.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-02-12 02:17:38 +0800
committerRunxi Yu <me@runxiyu.org>2025-02-12 02:17:38 +0800
commit7fff703cb8e94255bd285c2ba879f3ae19097238 (patch)
tree988ab939c4db6fc0b594b2dd9d7c028001d3c7f6 /handle_repo_commit.go
parentgit_misc.go: Reformat (diff)
downloadforge-7fff703cb8e94255bd285c2ba879f3ae19097238.tar.gz
forge-7fff703cb8e94255bd285c2ba879f3ae19097238.tar.zst
forge-7fff703cb8e94255bd285c2ba879f3ae19097238.zip
repo_commit: Add missing error check
Diffstat (limited to 'handle_repo_commit.go')
-rw-r--r--handle_repo_commit.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/handle_repo_commit.go b/handle_repo_commit.go
index aeea380..58c3992 100644
--- a/handle_repo_commit.go
+++ b/handle_repo_commit.go
@@ -52,6 +52,10 @@ func handle_repo_commit(w http.ResponseWriter, r *http.Request) {
data["commit_id"] = commit_id_string
parent_commit_hash, patch, err := get_patch_from_commit(commit_object)
+ if err != nil {
+ _, _ = w.Write([]byte("Error getting patch from commit: " + err.Error()))
+ return
+ }
data["parent_commit_hash"] = parent_commit_hash.String()
data["patch"] = patch