From 75ecfce39703e15a9f3d812faa4eb039935c8962 Mon Sep 17 00:00:00 2001 From: Christian Couder Date: Sat, 26 Apr 2008 15:19:29 +0200 Subject: [PATCH] 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 --- builtin-rev-parse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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(); -- 2.26.2