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>
This commit is contained in:
Jonathan Nieder
2009-11-09 09:05:01 -06:00
committed by Junio C Hamano
parent 548d3464dc
commit 99caeed05d
8 changed files with 35 additions and 14 deletions

View File

@ -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().