aboutsummaryrefslogtreecommitdiffstats
path: root/revision.c
diff options
context:
space:
mode:
authorMatt Hunter <m@lfurio.us>2025-03-30 07:24:06 -0400
committerJunio C Hamano <gitster@pobox.com>2025-04-01 02:57:26 -0700
commite7ef4be7c25c4968d8c5c51e6e748a1927f67194 (patch)
tree58b67f3212771dcb569d2f762173a3d8cbb3ccd9 /revision.c
parent683c54c999c301c2cd6f715c411407c413b1d84e (diff)
downloadgit-e7ef4be7c25c4968d8c5c51e6e748a1927f67194.tar.gz
revision: fix --left/right-only use with unrelated histories
This is a similar fix as 023756f4eb (revision walker: --cherry-pick is a limited operation), but for the --left-only and --right-only options. When computing a symmetric difference between two unrelated histories, no suitable merge base exists, and so no boundary commit is flagged as UNINTERESTING. Previously, we relied on the presence of such boundary to trigger limiting and thus consideration of either "revs->left_only" or "revs->right_only". A number of other entries in the option parser have started including overrides for "revs->limited = 1". Do the same for these options. Signed-off-by: Matt Hunter <m@lfurio.us> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'revision.c')
-rw-r--r--revision.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/revision.c b/revision.c
index c4390f0938..e045445bc3 100644
--- a/revision.c
+++ b/revision.c
@@ -2488,10 +2488,12 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
die(_("options '%s' and '%s' cannot be used together"),
"--left-only", "--right-only/--cherry");
revs->left_only = 1;
+ revs->limited = 1;
} else if (!strcmp(arg, "--right-only")) {
if (revs->left_only)
die(_("options '%s' and '%s' cannot be used together"), "--right-only", "--left-only");
revs->right_only = 1;
+ revs->limited = 1;
} else if (!strcmp(arg, "--cherry")) {
if (revs->left_only)
die(_("options '%s' and '%s' cannot be used together"), "--cherry", "--left-only");