Skip to content

Commit

Permalink
rev-parse: fix --verify to error out when passed junk after a good rev
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
chriscool authored and gitster committed Apr 27, 2008
1 parent 498a6e7 commit 75ecfce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions builtin-rev-parse.c
Expand Up @@ -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();
Expand Down

0 comments on commit 75ecfce

Please sign in to comment.