]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'md/exclude-promisor-objects-fix' into maint
authorJunio C Hamano <gitster@pobox.com>
Wed, 21 Nov 2018 13:57:52 +0000 (22:57 +0900)
committerJunio C Hamano <gitster@pobox.com>
Wed, 21 Nov 2018 13:57:52 +0000 (22:57 +0900)
Operations on promisor objects make sense in the context of only a
small subset of the commands that internally use the revisions
machinery, but the "--exclude-promisor-objects" option were taken
and led to nonsense results by commands like "log", to which it
didn't make much sense.  This has been corrected.

* md/exclude-promisor-objects-fix:
  exclude-promisor-objects: declare when option is allowed
  Documentation/git-log.txt: do not show --exclude-promisor-objects

1  2 
builtin/pack-objects.c
builtin/prune.c
builtin/rev-list.c
revision.c
revision.h
t/t4202-log.sh

Simple merge
diff --cc builtin/prune.c
index b29ce4abbce006ae63424352dec80de530202ec1,a5c784749eaebd92655800ab87b2df5512501603..d356ad70f6c3ad06112420e5a5f984fa38f09473
@@@ -118,8 -116,9 +118,9 @@@ int cmd_prune(int argc, const char **ar
  
        expire = TIME_MAX;
        save_commit_buffer = 0;
 -      check_replace_refs = 0;
 +      read_replace_refs = 0;
        ref_paranoia = 1;
+       revs.allow_exclude_promisor_objects_opt = 1;
        init_revisions(&revs, prefix);
  
        argc = parse_options(argc, argv, prefix, options, prune_usage, 0);
Simple merge
diff --cc revision.c
index de4dce600d00282655907e9014228791a352f813,748310c2a3b194322dae8fe586b9a247c186a6b1..e411802ebec37604a693993cb5e9f2df18dae895
@@@ -2133,9 -2105,10 +2133,10 @@@ static int handle_revision_opt(struct r
                revs->limited = 1;
        } else if (!strcmp(arg, "--ignore-missing")) {
                revs->ignore_missing = 1;
-       } else if (!strcmp(arg, "--exclude-promisor-objects")) {
+       } else if (revs->allow_exclude_promisor_objects_opt &&
+                  !strcmp(arg, "--exclude-promisor-objects")) {
                if (fetch_if_missing)
 -                      die("BUG: exclude_promisor_objects can only be used when fetch_if_missing is 0");
 +                      BUG("exclude_promisor_objects can only be used when fetch_if_missing is 0");
                revs->exclude_promisor_objects = 1;
        } else {
                int opts = diff_opt_parse(&revs->diffopt, argv, argc, revs->prefix);
diff --cc revision.h
Simple merge
diff --cc t/t4202-log.sh
Simple merge