From: Christian Couder Date: Sat, 26 Apr 2008 13:19:29 +0000 (+0200) Subject: rev-parse: fix --verify to error out when passed junk after a good rev X-Git-Tag: v1.5.6-rc0~121 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=75ecfce39703e15a9f3d812faa4eb039935c8962;p=git.git rev-parse: fix --verify to error out when passed junk after a good rev Before this patch something like: $ git rev-parse --verify worked whatever junk was as long as 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 Signed-off-by: Junio C Hamano --- diff --git a/builtin-rev-parse.c b/builtin-rev-parse.c index 9384a991e..0e5970732 100644 --- a/builtin-rev-parse.c +++ b/builtin-rev-parse.c @@ -576,11 +576,11 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix) show_rev(REVERSED, sha1, arg+1); continue; } + if (verify) + die_no_single_rev(quiet); as_is = 1; if (!show_file(arg)) continue; - if (verify) - die_no_single_rev(quiet); verify_filename(prefix, arg); } show_default();