summaryrefslogtreecommitdiff
path: root/builtin-reflog.c
diff options
context:
space:
mode:
authorLibravatar Jonathan Nieder <jrnieder@gmail.com>2009-11-09 09:05:01 -0600
committerLibravatar Junio C Hamano <gitster@pobox.com>2009-11-10 12:00:21 -0800
commit99caeed05d3e89176d352104a2b70a77aa7e5d81 (patch)
treef65515f8b4302877d661176266cd6bf9a75e5a53 /builtin-reflog.c
parentShow usage string for 'git http-push -h' (diff)
downloadtgif-99caeed05d3e89176d352104a2b70a77aa7e5d81.tar.xz
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 'builtin-reflog.c')
-rw-r--r--builtin-reflog.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/builtin-reflog.c b/builtin-reflog.c
index e23b5ef979..749821078d 100644
--- a/builtin-reflog.c
+++ b/builtin-reflog.c
@@ -698,6 +698,9 @@ static const char reflog_usage[] =
int cmd_reflog(int argc, const char **argv, const char *prefix)
{
+ if (argc > 1 && !strcmp(argv[1], "-h"))
+ usage(reflog_usage);
+
/* With no command, we default to showing it. */
if (argc < 2 || *argv[1] == '-')
return cmd_log_reflog(argc, argv, prefix);