@matheusbsbs / matheus-bagliano / commits / 24852d9171
Fork 0

rev-list: --left/right-only are mutually exclusive

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed Feb 21, 2011 at 16:58 UTC 24852d917104e294726c54803d5c9012997506ca
1 file changed +4
revision.c
+4
@@ -1284,8 +1284,12 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
1284 } else if (!strcmp(arg, "--left-right")) {
1285 revs->left_right = 1;
1286 } else if (!strcmp(arg, "--left-only")) {
1287 + if (revs->right_only)
1288 + die("--left-only is incompatible with --right-only");
1289 revs->left_only = 1;
1290 } else if (!strcmp(arg, "--right-only")) {
1291 + if (revs->left_only)
1292 + die("--right-only is incompatible with --left-only");
1293 revs->right_only = 1;
1294 } else if (!strcmp(arg, "--count")) {
1295 revs->count = 1;