mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-15 06:22:41 +00:00
fix: hook post-receive for sha256 repos
(cherry picked from commit 5e73c67d67
)
This commit is contained in:
parent
6de1f714f3
commit
3f9f6f1350
8 changed files with 50 additions and 22 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue