diff options
author | Runxi Yu <me@runxiyu.org> | 2025-04-06 01:30:02 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-04-06 01:30:02 +0800 |
commit | 7b7e20e60c1c6b858ae0c4eb78d414912263642f (patch) | |
tree | 988bc0a39e142dcfd52af98ec65e11578474002c /internal/oldgit/fmtpatch.go | |
parent | irc: Factor the IRC stuff into its own package (diff) | |
download | forge-7b7e20e60c1c6b858ae0c4eb78d414912263642f.tar.gz forge-7b7e20e60c1c6b858ae0c4eb78d414912263642f.tar.zst forge-7b7e20e60c1c6b858ae0c4eb78d414912263642f.zip |
oldgit: Separate some go-git stuff into here
Diffstat (limited to '')
-rw-r--r-- | internal/oldgit/fmtpatch.go (renamed from git_format_patch.go) | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/git_format_patch.go b/internal/oldgit/fmtpatch.go index 5628ce1..79be5d8 100644 --- a/git_format_patch.go +++ b/internal/oldgit/fmtpatch.go @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0-only // SPDX-FileCopyrightText: Copyright (c) 2025 Runxi Yu <https://runxiyu.org> -package forge +package oldgit import ( "bytes" @@ -12,16 +12,16 @@ import ( "github.com/go-git/go-git/v5/plumbing/object" ) -// fmtCommitPatch formats a commit object as if it was returned by +// FmtCommitPatch formats a commit object as if it was returned by // git-format-patch. -func fmtCommitPatch(commit *object.Commit) (final string, err error) { +func FmtCommitPatch(commit *object.Commit) (final string, err error) { var patch *object.Patch var buf bytes.Buffer var author object.Signature var date string var commitTitle, commitDetails string - if _, patch, err = commitToPatch(commit); err != nil { + if _, patch, err = CommitToPatch(commit); err != nil { return "", err } |