Commits

Anonymous committed 2baaae8 Merge with conflicts

Merge branch 'ft/transport-report-segv' into jch

A failure to push due to non-ff while on an unborn branch
dereferenced a NULL pointer while showing an error message.

Will merge to 'next'.

* ft/transport-report-segv:
push: fix segfault when HEAD points nowhere

Conflicts:
transport.c

Comments (0)

Files changed (1)

 		    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;