summaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2018-10-29 06:15:25 +0800
committertechknowlogick <hello@techknowlogick.com>2018-10-28 18:15:25 -0400
commita2ee2a3c67304920a968c1c852e43b3dc2d7c3e7 (patch)
tree7f559a629f22089dfefcd14947079cc7712565a2 /cmd
parentfb14458010e1c18dc08549bbe83cab56fc690bc7 (diff)
downloadgitea-a2ee2a3c67304920a968c1c852e43b3dc2d7c3e7.tar.gz
gitea-a2ee2a3c67304920a968c1c852e43b3dc2d7c3e7.zip
fix showing pull request link when delete a branch (#5166)
Diffstat (limited to 'cmd')
-rw-r--r--cmd/hook.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd/hook.go b/cmd/hook.go
index 70849f5142..27500f9c66 100644
--- a/cmd/hook.go
+++ b/cmd/hook.go
@@ -214,7 +214,7 @@ func runHookPostReceive(c *cli.Context) error {
log.GitLogger.Error(2, "Update: %v", err)
}
- if strings.HasPrefix(refFullName, git.BranchPrefix) {
+ if newCommitID != git.EmptySHA && strings.HasPrefix(refFullName, git.BranchPrefix) {
branch := strings.TrimPrefix(refFullName, git.BranchPrefix)
repo, pullRequestAllowed, err := private.GetRepository(repoID)
if err != nil {