Skip to content

Commit 0baebca

Browse files
committed
Merge branch 'jx/do-not-crash-receive-pack-wo-head'
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
2 parents 0c54706 + b112b14 commit 0baebca

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin/receive-pack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -933,7 +933,7 @@ static const char *update(struct command *cmd, struct shallow_info *si)
933933
return "deletion prohibited";
934934
}
935935

936-
if (!strcmp(namespaced_name, head_name)) {
936+
if (head_name && !strcmp(namespaced_name, head_name)) {
937937
switch (deny_delete_current) {
938938
case DENY_IGNORE:
939939
break;

0 commit comments

Comments
 (0)