summaryrefslogtreecommitdiff
path: root/index-pack.c
diff options
context:
space:
mode:
authorJonathan Nieder <jrnieder@gmail.com>2009-11-09 15:05:01 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-11-10 20:00:21 (GMT)
commit99caeed05d3e89176d352104a2b70a77aa7e5d81 (patch)
treef65515f8b4302877d661176266cd6bf9a75e5a53 /index-pack.c
parent548d3464dc446db58a8fc8f7a8cc6cfb2d683faa (diff)
downloadgit-99caeed05d3e89176d352104a2b70a77aa7e5d81.zip
git-99caeed05d3e89176d352104a2b70a77aa7e5d81.tar.gz
git-99caeed05d3e89176d352104a2b70a77aa7e5d81.tar.bz2
Let 'git <command> -h' show usage without a git dir
There is no need for "git <command> -h" to depend on being inside a repository. Reported by Gerfried Fuchs through http://bugs.debian.org/462557 Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'index-pack.c')
-rw-r--r--index-pack.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/index-pack.c b/index-pack.c
index b4f8278..190f372 100644
--- a/index-pack.c
+++ b/index-pack.c
@@ -882,6 +882,9 @@ int main(int argc, char **argv)
git_extract_argv0_path(argv[0]);
+ if (argc == 2 && !strcmp(argv[1], "-h"))
+ usage(index_pack_usage);
+
/*
* We wish to read the repository's config file if any, and
* for that it is necessary to call setup_git_directory_gently().