Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Nieder <jrnieder@gmail.com>2009-11-09 18:04:56 +0300
committerJunio C Hamano <gitster@pobox.com>2009-11-10 22:06:57 +0300
commit1507301204180a17f915b929fc8377e69aef979d (patch)
tree7cb6064c96698fe1d4c2679be38796b6c8b0d4a3 /unpack-file.c
parent03c5c10263fb0d80151d108a4c61253e1d0a8de6 (diff)
Show usage string for 'git unpack-file -h'
"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>
Diffstat (limited to 'unpack-file.c')
-rw-r--r--unpack-file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/unpack-file.c b/unpack-file.c
index ac9cbf7cd8..e9d8934691 100644
--- a/unpack-file.c
+++ b/unpack-file.c
@@ -28,7 +28,7 @@ int main(int argc, char **argv)
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]);