Skip to content

Commit

Permalink
Merge branch 'jx/do-not-crash-receive-pack-wo-head'
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Junio C Hamano committed Aug 3, 2015
2 parents 0c54706 + b112b14 commit 0baebca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion builtin/receive-pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,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;
Expand Down

0 comments on commit 0baebca

Please sign in to comment.