summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 03c5c10)
raw | patch | inline | side by side (parent: 03c5c10)
author | Jonathan Nieder <jrnieder@gmail.com> | |
Mon, 9 Nov 2009 15:04:56 +0000 (09:04 -0600) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 10 Nov 2009 19:06:57 +0000 (11:06 -0800) |
"unpack-file -h" could be asking to save the contents of a blob
named "-h". Strictly speaking, such a pathological ref name is
possible, but the user would have to had said something like
"tags/-h" to name such a pathological ref already. When used in
scripts, unpack-file is typically not passed a user-supplied tag
name directly.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
named "-h". Strictly speaking, such a pathological ref name is
possible, but the user would have to had said something like
"tags/-h" to name such a pathological ref already. When used in
scripts, unpack-file is typically not passed a user-supplied tag
name directly.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
unpack-file.c | patch | blob | history |
diff --git a/unpack-file.c b/unpack-file.c
index ac9cbf7cd8ed1367151de0e8b96668f498b7f1a1..e9d8934691822ad81a4c32481d82790e9d7ca5b0 100644 (file)
--- a/unpack-file.c
+++ b/unpack-file.c
git_extract_argv0_path(argv[0]);
- if (argc != 2)
+ if (argc != 2 || !strcmp(argv[1], "-h"))
usage("git unpack-file <sha1>");
if (get_sha1(argv[1], sha1))
die("Not a valid object name %s", argv[1]);