1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-09-15 18:56:59 +00:00

Merge branch 'forgejo' into forgejo-federated-star

This commit is contained in:
Michael Jerger 2024-05-16 18:28:43 +02:00
commit 86db5f612c
35 changed files with 450 additions and 352 deletions

View file

@ -21,14 +21,12 @@ type PushUpdateOptions struct {
// IsNewRef return true if it's a first-time push to a branch, tag or etc.
func (opts *PushUpdateOptions) IsNewRef() bool {
commitID, err := git.NewIDFromString(opts.OldCommitID)
return err == nil && commitID.IsZero()
return git.IsEmptyCommitID(opts.OldCommitID, nil)
}
// IsDelRef return true if it's a deletion to a branch or tag
func (opts *PushUpdateOptions) IsDelRef() bool {
commitID, err := git.NewIDFromString(opts.NewCommitID)
return err == nil && commitID.IsZero()
return git.IsEmptyCommitID(opts.NewCommitID, nil)
}
// IsUpdateRef return true if it's an update operation