]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'jx/do-not-crash-receive-pack-wo-head' into maint
authorJunio C Hamano <gitster@pobox.com>
Wed, 19 Aug 2015 21:41:26 +0000 (14:41 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 19 Aug 2015 21:41:26 +0000 (14:41 -0700)
An attempt to delete a ref by pushing into a repositorywhose HEAD
symbolic reference points at an unborn branch that cannot be
created due to ref D/F conflict (e.g. refs/heads/a/b exists, HEAD
points at refs/heads/a) failed.

* jx/do-not-crash-receive-pack-wo-head:
  receive-pack: crash when checking with non-exist HEAD

builtin/receive-pack.c

index 94d05717766151e6b183e2c21d279e72812aeb03..04cb5a1a060ae0f26d9d49eb02b57408b9c71929 100644 (file)
@@ -911,7 +911,7 @@ static const char *update(struct command *cmd, struct shallow_info *si)
                        return "deletion prohibited";
                }
 
-               if (!strcmp(namespaced_name, head_name)) {
+               if (head_name && !strcmp(namespaced_name, head_name)) {
                        switch (deny_delete_current) {
                        case DENY_IGNORE:
                                break;