author | Junio C Hamano <gitster@pobox.com> | |
Fri, 16 Sep 2011 18:14:27 +0000 (11:14 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 16 Sep 2011 18:19:43 +0000 (11:19 -0700) | ||
commit | 91a640ffb6d9dd10c293a575a692d9771b6e13c7 | |
tree | 57d7b2bc83a467e8b5b6bdb22de36769b1ef7b98 | tree | snapshot |
parent | 87b50542a08ac6caa083ddc376e674424e37940a | commit | diff |
ls-remote: a lone "-h" is asking for help
What should happen if you run this command?
$ git ls-remote -h
It does not give a short-help for the command. Instead because "-h" is a
synonym for "--heads", it runs "git ls-remote --heads", and because there
is no remote specified on the command line, we run it against the default
"origin" remote, hence end up doing the same as
$ git ls-remote --heads origin
Fix this counter-intuitive behaviour by special casing a lone "-h" that
does not have anything else on the command line and calling usage().
Signed-off-by: Junio C Hamano <gitster@pobox.com>
What should happen if you run this command?
$ git ls-remote -h
It does not give a short-help for the command. Instead because "-h" is a
synonym for "--heads", it runs "git ls-remote --heads", and because there
is no remote specified on the command line, we run it against the default
"origin" remote, hence end up doing the same as
$ git ls-remote --heads origin
Fix this counter-intuitive behaviour by special casing a lone "-h" that
does not have anything else on the command line and calling usage().
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/ls-remote.c | diff | blob | history |