Show usage string for 'git http-push -h'
authorJonathan Nieder <jrnieder@gmail.com>
Mon, 9 Nov 2009 10:47:34 +0000 (04:47 -0600)
committerJunio C Hamano <gitster@pobox.com>
Tue, 10 Nov 2009 19:59:51 +0000 (11:59 -0800)
http-push already knows how to dump usage if it is given no options, but
it interprets '-h' as the URL to a remote repository:

$ git http-push -h
error: Cannot access URL -h/, return code 6

Dump usage instead. Humans wanting to pass the URL -h/ to curl for some
reason can use 'git http-push -h/' explicitly. Scripts expecting to
access an HTTP repository at URL '-h' will break, though.

Also delay finding a git directory until after option parsing, so
"http-push -h" can be used outside any git repository.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
No differences found