]> source.dussan.org Git - gitea.git/commitdiff
fix showing pull request link when delete a branch (#5166)
authorLunny Xiao <xiaolunwen@gmail.com>
Sun, 28 Oct 2018 22:15:25 +0000 (06:15 +0800)
committertechknowlogick <hello@techknowlogick.com>
Sun, 28 Oct 2018 22:15:25 +0000 (18:15 -0400)
cmd/hook.go

index 70849f5142c8e7b9c33f6cb089175fb9fc395918..27500f9c666d0daba21c8bcf4cef9bf46e389b85 100644 (file)
@@ -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 {