mirror of
https://github.com/git/git.git
synced 2024-11-24 18:33:43 +08:00
Merge branch 'ft/transport-report-segv'
A failure to push due to non-ff while on an unborn branch dereferenced a NULL pointer when showing an error message. * ft/transport-report-segv: push: fix segfault when HEAD points nowhere
This commit is contained in:
commit
8278a7bdc1
@ -752,7 +752,7 @@ void transport_print_push_status(const char *dest, struct ref *refs,
|
||||
ref->status != REF_STATUS_OK)
|
||||
n += print_one_push_status(ref, dest, n, porcelain);
|
||||
if (ref->status == REF_STATUS_REJECT_NONFASTFORWARD) {
|
||||
if (!strcmp(head, ref->name))
|
||||
if (head != NULL && !strcmp(head, ref->name))
|
||||
*reject_reasons |= REJECT_NON_FF_HEAD;
|
||||
else
|
||||
*reject_reasons |= REJECT_NON_FF_OTHER;
|
||||
|
Loading…
Reference in New Issue
Block a user