From a2ee2a3c67304920a968c1c852e43b3dc2d7c3e7 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Mon, 29 Oct 2018 06:15:25 +0800 Subject: fix showing pull request link when delete a branch (#5166) --- cmd/hook.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmd') 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 { -- cgit v1.2.3