diff- and log- family: handle "git cmd -h" early
authorJunio C Hamano <gitster@pobox.com>
Thu, 1 Jun 2017 04:38:16 +0000 (13:38 +0900)
committerJunio C Hamano <gitster@pobox.com>
Mon, 5 Jun 2017 02:39:59 +0000 (11:39 +0900)
"git $builtin -h" bypasses the usual repository setup and calls the
cmd_$builtin() function, expecting it to show the help text.

Unfortunately the commands in the log- and the diff- family want to
call into the revisions machinery, which by definition needs to have
a repository already discovered. Strictly speaking, they may not
need a repository only for parsing "-h", but it is a good discipline
to future-proof codepath to ensure that setup_revisions() is called
after we know that a repository is there.

Handle the "git $builtin -h" special case very early in these
commands to work around potential issues.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
No differences found