aboutsummaryrefslogtreecommitdiff
path: root/http_handle_repo_commit.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-04-06 01:30:02 +0800
committerRunxi Yu <me@runxiyu.org>2025-04-06 01:30:02 +0800
commit7b7e20e60c1c6b858ae0c4eb78d414912263642f (patch)
tree988bc0a39e142dcfd52af98ec65e11578474002c /http_handle_repo_commit.go
parentirc: Factor the IRC stuff into its own package (diff)
downloadforge-7b7e20e60c1c6b858ae0c4eb78d414912263642f.tar.gz
forge-7b7e20e60c1c6b858ae0c4eb78d414912263642f.tar.zst
forge-7b7e20e60c1c6b858ae0c4eb78d414912263642f.zip
oldgit: Separate some go-git stuff into here
Diffstat (limited to 'http_handle_repo_commit.go')
-rw-r--r--http_handle_repo_commit.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/http_handle_repo_commit.go b/http_handle_repo_commit.go
index 196489f..22ee20d 100644
--- a/http_handle_repo_commit.go
+++ b/http_handle_repo_commit.go
@@ -14,6 +14,7 @@ import (
"github.com/go-git/go-git/v5/plumbing/format/diff"
"github.com/go-git/go-git/v5/plumbing/object"
"go.lindenii.runxiyu.org/forge/internal/misc"
+ "go.lindenii.runxiyu.org/forge/internal/oldgit"
"go.lindenii.runxiyu.org/forge/internal/web"
)
@@ -52,7 +53,7 @@ func (s *Server) httpHandleRepoCommit(writer http.ResponseWriter, request *http.
}
if commitIDStrSpecNoSuffix != commitIDStrSpec {
var patchStr string
- if patchStr, err = fmtCommitPatch(commitObj); err != nil {
+ if patchStr, err = oldgit.FmtCommitPatch(commitObj); err != nil {
web.ErrorPage500(s.templates, writer, params, "Error formatting patch: "+err.Error())
return
}
@@ -69,7 +70,7 @@ func (s *Server) httpHandleRepoCommit(writer http.ResponseWriter, request *http.
params["commit_object"] = commitObj
params["commit_id"] = commitIDStr
- parentCommitHash, patch, err = commitToPatch(commitObj)
+ parentCommitHash, patch, err = oldgit.CommitToPatch(commitObj)
if err != nil {
web.ErrorPage500(s.templates, writer, params, "Error getting patch from commit: "+err.Error())
return