aboutsummaryrefslogtreecommitdiffstats
path: root/modules/git/sha1.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2023-06-15 08:14:43 +0800
committerGitHub <noreply@github.com>2023-06-15 02:14:43 +0200
commitcc3910d8c32f0c63257ff09ff5b9174d6224157b (patch)
tree56202772350558cf2e5000d641cdf7750ae00b3f /modules/git/sha1.go
parent5440d37c706a637085ce650d0ea10eaae9281d5b (diff)
downloadgitea-cc3910d8c32f0c63257ff09ff5b9174d6224157b.tar.gz
gitea-cc3910d8c32f0c63257ff09ff5b9174d6224157b.zip
Fix index generation parallelly failure (#25235)
Fix #22109 --------- Co-authored-by: silverwind <me@silverwind.io>
Diffstat (limited to 'modules/git/sha1.go')
-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