Merge branch 'fc/push-prune'
authorJunio C Hamano <gitster@pobox.com>
Mon, 27 Feb 2012 07:05:45 +0000 (23:05 -0800)
committerJunio C Hamano <gitster@pobox.com>
Mon, 27 Feb 2012 07:05:45 +0000 (23:05 -0800)
* 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

1  2 
builtin/push.c
transport.c
diff --combined builtin/push.c
index 6c373cf28bfc9d8409014d84eef5b886218b25ab,fdfb2c4512e98b0448f710bf3162ef948cd52ded..d315475f16c96a831a11c2aebf00ada40b7c9663
@@@ -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 401b8dd35ce9acd88f38440fc52b908898119a81,c20267ce4f81053e4451b3502eef5e646abaf2d2..181f8f24d14e91c106b1d36133292a7ee99333fb
@@@ -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,
                        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)) {