From 3a5f30874120880ddaa53d0db4c3b4ec0a07297a Mon Sep 17 00:00:00 2001 From: René Scharfe Date: Fri, 21 Jul 2023 14:41:56 +0200 Subject: pack-objects: fix --no-keep-true-parents MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since 99fb6e04cb (pack-objects: convert to use parse_options(), 2012-02-01) git pack-objects has accepted --no-keep-true-parents, but this option does the same as --keep-true-parents. That's because it's defined using OPT_SET_INT with a value of 0, which sets 0 when negated as well. Turn --no-keep-true-parents into the opposite of --keep-true-parents by using OPT_BOOL and storing the option's status directly in a variable named "grafts_keep_true_parents" instead of in negative form in "grafts_replace_parents". Signed-off-by: René Scharfe Signed-off-by: Junio C Hamano --- commit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'commit.c') diff --git a/commit.c b/commit.c index 0fb9316931..2fbbf24576 100644 --- a/commit.c +++ b/commit.c @@ -516,7 +516,7 @@ int parse_commit_buffer(struct repository *r, struct commit *item, const void *b * The clone is shallow if nr_parent < 0, and we must * not traverse its real parents even when we unhide them. */ - if (graft && (graft->nr_parent < 0 || grafts_replace_parents)) + if (graft && (graft->nr_parent < 0 || !grafts_keep_true_parents)) continue; new_parent = lookup_commit(r, &parent); if (!new_parent) -- cgit 1.2.3-korg