Pass all rejection reasons back from transport_push(). The logic is
simpler and more flexible with regard to providing useful feedback.
Signed-off-by: Chris Rorvick <chris@rorvick.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Chris Rorvick12 years agocommitted byJunio C Hamano
@ -257,7 +257,7 @@ static int push_with_options(struct transport *transport, int flags)
@@ -257,7 +257,7 @@ static int push_with_options(struct transport *transport, int flags)
if (verbosity > 0)
fprintf(stderr, _("Pushing to %s\n"), transport->url);
error(_("failed to push some refs to '%s'"), transport->url);
@ -265,18 +265,13 @@ static int push_with_options(struct transport *transport, int flags)
@@ -265,18 +265,13 @@ static int push_with_options(struct transport *transport, int flags)
if (!err)
return 0;
switch (nonfastforward) {
default:
break;
case NON_FF_HEAD:
if (reject_reasons & REJECT_NON_FF_HEAD) {
advise_pull_before_push();
break;
case NON_FF_OTHER:
} else if (reject_reasons & REJECT_NON_FF_OTHER) {
@ -714,7 +714,7 @@ static int print_one_push_status(struct ref *ref, const char *dest, int count, i
@@ -714,7 +714,7 @@ static int print_one_push_status(struct ref *ref, const char *dest, int count, i