diff options
author | Junio C Hamano <gitster@pobox.com> | 2022-02-18 21:53:30 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-02-18 21:53:30 (GMT) |
commit | c5973cb98ff4fe0779e90e04de7c099cc2256a3a (patch) | |
tree | d09aedb1405c3b20e31b81c982edf697e4036fbc /builtin/pull.c | |
parent | 9b7e531f94c610439cff3c8d4556742524184463 (diff) | |
parent | 87ad07d735448a72d4e1fc4f3ce1e6b44bc613f5 (diff) | |
download | git-c5973cb98ff4fe0779e90e04de7c099cc2256a3a.zip git-c5973cb98ff4fe0779e90e04de7c099cc2256a3a.tar.gz git-c5973cb98ff4fe0779e90e04de7c099cc2256a3a.tar.bz2 |
Merge branch 'js/short-help-outside-repo-fix'
"git cmd -h" outside a repository should error out cleanly for many
commands, but instead it hit a BUG(), which has been corrected.
* js/short-help-outside-repo-fix:
t0012: verify that built-ins handle `-h` even without gitdir
checkout/fetch/pull/pack-objects: allow `-h` outside a repository
Diffstat (limited to 'builtin/pull.c')
-rw-r--r-- | builtin/pull.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/builtin/pull.c b/builtin/pull.c index 8f37880..3768552 100644 --- a/builtin/pull.c +++ b/builtin/pull.c @@ -994,8 +994,10 @@ int cmd_pull(int argc, const char **argv, const char *prefix) set_reflog_message(argc, argv); git_config(git_pull_config, NULL); - prepare_repo_settings(the_repository); - the_repository->settings.command_requires_full_index = 0; + if (the_repository->gitdir) { + prepare_repo_settings(the_repository); + the_repository->settings.command_requires_full_index = 0; + } argc = parse_options(argc, argv, prefix, pull_options, pull_usage, 0); |