diff options
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/push.c | 13 | ||||
-rw-r--r-- | builtin/send-pack.c | 4 |
2 files changed, 6 insertions, 11 deletions
diff --git a/builtin/push.c b/builtin/push.c index db9ba30b08..9d17fc799c 100644 --- a/builtin/push.c +++ b/builtin/push.c @@ -244,7 +244,7 @@ static void advise_checkout_pull_push(void) static int push_with_options(struct transport *transport, int flags) { int err; - int nonfastforward; + unsigned int reject_reasons; transport_set_verbosity(transport, verbosity, progress); @@ -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); err = transport_push(transport, refspec_nr, refspec, flags, - &nonfastforward); + &reject_reasons); if (err != 0) error(_("failed to push some refs to '%s'"), transport->url); @@ -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) { if (default_matching_used) advise_use_upstream(); else advise_checkout_pull_push(); - break; } return 1; diff --git a/builtin/send-pack.c b/builtin/send-pack.c index d34201372d..9f986077aa 100644 --- a/builtin/send-pack.c +++ b/builtin/send-pack.c @@ -85,7 +85,7 @@ int cmd_send_pack(int argc, const char **argv, const char *prefix) int send_all = 0; const char *receivepack = "git-receive-pack"; int flags; - int nonfastforward = 0; + unsigned int reject_reasons; int progress = -1; argv++; @@ -223,7 +223,7 @@ int cmd_send_pack(int argc, const char **argv, const char *prefix) ret |= finish_connect(conn); if (!helper_status) - transport_print_push_status(dest, remote_refs, args.verbose, 0, &nonfastforward); + transport_print_push_status(dest, remote_refs, args.verbose, 0, &reject_reasons); if (!args.dry_run && remote) { struct ref *ref; |