summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorGiteabot <teabot@gitea.io>2023-06-14 22:14:00 -0400
committerGitHub <noreply@github.com>2023-06-15 02:14:00 +0000
commit031ddfcb7b173684de66c622370ffeff5438ac52 (patch)
treecf6a36e7fdff305c2afc2990bb5330201fd32fd3 /modules
parentd686aa0d31e039bc409d5bee385c27c7fbb2c47f (diff)
downloadgitea-031ddfcb7b173684de66c622370ffeff5438ac52.tar.gz
gitea-031ddfcb7b173684de66c622370ffeff5438ac52.zip
Fix index generation parallelly failure (#25235) (#25269)
Backport #25235 by @lunny Fix #22109 Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: silverwind <me@silverwind.io>
Diffstat (limited to 'modules')
-rw-r--r--modules/git/sha1.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/modules/git/sha1.go b/modules/git/sha1.go
index 4d69653e09..7d9d9776da 100644
--- a/modules/git/sha1.go
+++ b/modules/git/sha1.go
@@ -28,6 +28,14 @@ func IsValidSHAPattern(sha string) bool {
return shaPattern.MatchString(sha)
}
+type ErrInvalidSHA struct {
+ SHA string
+}
+
+func (err ErrInvalidSHA) Error() string {
+ return fmt.Sprintf("invalid sha: %s", err.SHA)
+}
+
// MustID always creates a new SHA1 from a [20]byte array with no validation of input.
func MustID(b []byte) SHA1 {
var id SHA1