Merge branch 'ft/transport-report-segv' into maint
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
772847341b
@ -741,7 +741,7 @@ void transport_print_push_status(const char *dest, struct ref *refs,
|
|||||||
n += print_one_push_status(ref, dest, n, porcelain);
|
n += print_one_push_status(ref, dest, n, porcelain);
|
||||||
if (ref->status == REF_STATUS_REJECT_NONFASTFORWARD &&
|
if (ref->status == REF_STATUS_REJECT_NONFASTFORWARD &&
|
||||||
*nonfastforward != NON_FF_HEAD) {
|
*nonfastforward != NON_FF_HEAD) {
|
||||||
if (!strcmp(head, ref->name))
|
if (head != NULL && !strcmp(head, ref->name))
|
||||||
*nonfastforward = NON_FF_HEAD;
|
*nonfastforward = NON_FF_HEAD;
|
||||||
else
|
else
|
||||||
*nonfastforward = NON_FF_OTHER;
|
*nonfastforward = NON_FF_OTHER;
|
||||||
|
Loading…
Reference in New Issue
Block a user