Files
git/builtin
Jeff King f3a2fffe06 am: handle "-h" argument earlier
If the user provides "-h" on the command line, then our
parse_options() invocation will show a usage message and
quit. But if "-h" is the only argument, the git wrapper
behaves specially: it ignores our RUN_SETUP flag and calls
cmd_am() without having done repository setup at all.  This
is due to 99caeed05 (Let 'git <command> -h' show usage
without a git dir, 2009-11-09).

Before cmd_am() calls parse_options(), though, it runs a few
other setup functions. One of these is am_state_init(),
which uses git_pathdup() to set up the default rebase-apply
path. But calling git_pathdup() when we haven't done
repository setup will fall back to using ".git". That's
mostly harmless (since we won't use the value anyway), but
is forbidden since b1ef400eec ("setup_git_env: avoid blind
fall-back to ".git"", 2016-10-20), and we now BUG().

We can't easily move that setup to after the parse_options()
call; the point is to set up defaults that are overwritten
by the option parsing. Instead, we'll detect the "-h" case
early and show the usage then. This matches the behavior of
other builtins which have a similar setup-ordering issue
(e.g., git-branch).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-05-30 14:39:47 +09:00
..
2017-05-30 14:39:47 +09:00
2016-11-22 13:55:20 -08:00
2017-04-26 15:39:08 +09:00
2017-03-31 08:33:56 -07:00
2017-03-30 14:07:14 -07:00
2017-04-26 15:39:08 +09:00
2017-04-26 15:39:08 +09:00
2017-03-17 13:50:25 -07:00
2017-03-31 08:33:56 -07:00
2017-04-13 17:53:08 -07:00
2017-03-31 08:33:56 -07:00
2017-04-19 21:37:13 -07:00
2017-04-15 00:58:36 -07:00
2017-04-19 21:37:13 -07:00
2016-09-29 15:42:18 -07:00
2017-01-18 15:12:15 -08:00
2017-04-19 21:37:13 -07:00
2017-04-26 15:39:08 +09:00
2017-04-02 09:49:24 -07:00
2017-04-17 21:56:54 -07:00
2017-04-19 21:37:13 -07:00
2017-04-19 21:37:13 -07:00
2017-03-24 13:07:37 -07:00
2017-01-23 18:51:56 -08:00
2017-04-11 00:21:51 -07:00
2017-04-26 15:39:12 +09:00