From: Junio C Hamano Date: Wed, 11 Sep 2013 21:56:58 +0000 (-0700) Subject: Merge branch 'nd/push-no-thin' X-Git-Tag: v1.8.5-rc0~156 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/2de0f39cd27d8ab8eae2e3430b81294f26252693?hp=-c Merge branch 'nd/push-no-thin' "git push --no-thin" was a no-op by mistake. * nd/push-no-thin: push: respect --no-thin --- 2de0f39cd27d8ab8eae2e3430b81294f26252693 diff --combined builtin/push.c index 50bbfd62b1,333a1fb059..7b1b66c36a --- a/builtin/push.c +++ b/builtin/push.c @@@ -15,14 -15,12 +15,14 @@@ static const char * const push_usage[] NULL, }; - static int thin; + static int thin = 1; static int deleterefs; static const char *receivepack; static int verbosity; static int progress = -1; +static struct push_cas_option cas; + static const char **refspec; static int refspec_nr; static int refspec_alloc; @@@ -315,16 -313,8 +315,15 @@@ static int push_with_options(struct tra if (receivepack) transport_set_option(transport, TRANS_OPT_RECEIVEPACK, receivepack); - if (thin) - transport_set_option(transport, TRANS_OPT_THIN, "yes"); + transport_set_option(transport, TRANS_OPT_THIN, thin ? "yes" : NULL); + if (!is_empty_cas(&cas)) { + if (!transport->smart_options) + die("underlying transport does not support --%s option", + CAS_OPT_NAME); + transport->smart_options->cas = &cas; + } + if (verbosity > 0) fprintf(stderr, _("Pushing to %s\n"), transport->url); err = transport_push(transport, refspec_nr, refspec, flags, @@@ -455,19 -445,15 +454,19 @@@ int cmd_push(int argc, const char **arg OPT_BIT( 0 , "all", &flags, N_("push all refs"), TRANSPORT_PUSH_ALL), OPT_BIT( 0 , "mirror", &flags, N_("mirror all refs"), (TRANSPORT_PUSH_MIRROR|TRANSPORT_PUSH_FORCE)), - OPT_BOOLEAN( 0, "delete", &deleterefs, N_("delete refs")), - OPT_BOOLEAN( 0 , "tags", &tags, N_("push tags (can't be used with --all or --mirror)")), + OPT_BOOL( 0, "delete", &deleterefs, N_("delete refs")), + OPT_BOOL( 0 , "tags", &tags, N_("push tags (can't be used with --all or --mirror)")), OPT_BIT('n' , "dry-run", &flags, N_("dry run"), TRANSPORT_PUSH_DRY_RUN), OPT_BIT( 0, "porcelain", &flags, N_("machine-readable output"), TRANSPORT_PUSH_PORCELAIN), OPT_BIT('f', "force", &flags, N_("force updates"), TRANSPORT_PUSH_FORCE), + { OPTION_CALLBACK, + 0, CAS_OPT_NAME, &cas, N_("refname>: