From: Junio C Hamano Date: Mon, 27 Feb 2012 07:05:45 +0000 (-0800) Subject: Merge branch 'fc/push-prune' X-Git-Tag: v1.7.10-rc0~44 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/d365a432271d2f6384cda9c37fb2fe463bdc2850?ds=inline;hp=-c Merge branch 'fc/push-prune' * fc/push-prune: push: add '--prune' option remote: refactor code into alloc_delete_ref() remote: reorganize check_pattern_match() remote: use a local variable in match_push_refs() Conflicts: builtin/push.c --- d365a432271d2f6384cda9c37fb2fe463bdc2850 diff --combined builtin/push.c index 6c373cf28b,fdfb2c4512..d315475f16 --- a/builtin/push.c +++ b/builtin/push.c @@@ -19,7 -19,7 +19,7 @@@ static int thin static int deleterefs; static const char *receivepack; static int verbosity; -static int progress; +static int progress = -1; static const char **refspec; static int refspec_nr; @@@ -260,7 -260,9 +260,9 @@@ int cmd_push(int argc, const char **arg OPT_STRING( 0 , "exec", &receivepack, "receive-pack", "receive pack program"), OPT_BIT('u', "set-upstream", &flags, "set upstream for git pull/status", TRANSPORT_PUSH_SET_UPSTREAM), - OPT_BOOLEAN(0, "progress", &progress, "force progress reporting"), + OPT_BOOL(0, "progress", &progress, "force progress reporting"), + OPT_BIT(0, "prune", &flags, "prune locally removed refs", + TRANSPORT_PUSH_PRUNE), OPT_END() }; diff --combined transport.c index 401b8dd35c,c20267ce4f..181f8f24d1 --- a/transport.c +++ b/transport.c @@@ -993,15 -993,11 +993,15 @@@ void transport_set_verbosity(struct tra * Rules used to determine whether to report progress (processing aborts * when a rule is satisfied): * - * 1. Report progress, if force_progress is 1 (ie. --progress). - * 2. Don't report progress, if verbosity < 0 (ie. -q/--quiet ). - * 3. Report progress if isatty(2) is 1. + * . Report progress, if force_progress is 1 (ie. --progress). + * . Don't report progress, if force_progress is 0 (ie. --no-progress). + * . Don't report progress, if verbosity < 0 (ie. -q/--quiet ). + * . Report progress if isatty(2) is 1. **/ - transport->progress = force_progress || (verbosity >= 0 && isatty(2)); + if (force_progress >= 0) + transport->progress = !!force_progress; + else + transport->progress = verbosity >= 0 && isatty(2); } int transport_push(struct transport *transport, @@@ -1032,6 -1028,8 +1032,8 @@@ match_flags |= MATCH_REFS_ALL; if (flags & TRANSPORT_PUSH_MIRROR) match_flags |= MATCH_REFS_MIRROR; + if (flags & TRANSPORT_PUSH_PRUNE) + match_flags |= MATCH_REFS_PRUNE; if (match_push_refs(local_refs, &remote_refs, refspec_nr, refspec, match_flags)) {