@matheusbsbs / matheus-bagliano / commits / 75ecfce397
Fork 0

rev-parse: fix --verify to error out when passed junk after a good rev

Before this patch something like: $ git rev-parse --verify <good-rev> <junk> worked whatever junk was as long as <good-rev> could be parsed correctly. This patch makes "git rev-parse --verify" error out when passed any junk after a good rev. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Christian Couder committed Apr 26, 2008 at 15:19 UTC 75ecfce39703e15a9f3d812faa4eb039935c8962
1 file changed +2 -2
builtin-rev-parse.c
+2 -2
@@ -576,11 +576,11 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
576 show_rev(REVERSED, sha1, arg+1);
577 continue;
578 }
579 + if (verify)
580 + die_no_single_rev(quiet);
581 as_is = 1;
582 if (!show_file(arg))
583 continue;
582 - if (verify)
583 - die_no_single_rev(quiet);
584 verify_filename(prefix, arg);
585 }
586 show_default();