From: Junio C Hamano Date: Wed, 21 Nov 2018 13:57:52 +0000 (+0900) Subject: Merge branch 'md/exclude-promisor-objects-fix' into maint X-Git-Tag: v2.19.2~41 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b52ac60bc461a16076209a3027bb15f7c890f148;p=thirdparty%2Fgit.git Merge branch 'md/exclude-promisor-objects-fix' into maint 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 --- b52ac60bc461a16076209a3027bb15f7c890f148 diff --cc builtin/prune.c index b29ce4abbc,a5c784749e..d356ad70f6 --- a/builtin/prune.c +++ b/builtin/prune.c @@@ -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); diff --cc revision.c index de4dce600d,748310c2a3..e411802ebe --- a/revision.c +++ b/revision.c @@@ -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);