]> git.ipfire.org Git - thirdparty/git.git/commit - cache.h
setup: remember whether repository was found
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Fri, 6 Aug 2010 02:46:33 +0000 (21:46 -0500)
committerJunio C Hamano <gitster@pobox.com>
Wed, 11 Aug 2010 16:24:00 +0000 (09:24 -0700)
commita60645f9c54c3050cbe25882feba9d5b3d1ca0d6
treed35ccc244577a997491becdd5802dfe9bc50e4d7
parente37c1329fa86683c828f04b51bad8bae03939ced
setup: remember whether repository was found

As v1.7.2~16^2 (git --paginate: paginate external commands
again, 2010-07-14) explains, builtins (like git config) that
do not use RUN_SETUP are not finding GIT_DIR set correctly when
it is time to launch the pager from run_builtin().  If they
were to search for a repository sooner, then the outcome of such
early repository accesses would be more predictable and reliable.

The cmd_*() functions learn whether a repository was found through the
*nongit_ok return value from setup_git_directory_gently().  If
run_builtin() is to take care of the repository search itself, that
datum needs to be retrievable from somewhere else.  Use the
startup_info struct for this.

As a bonus, this information becomes available to functions such as
git_config() which might want to avoid trying to access a repository
when none is present.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
cache.h
setup.c