diff options
author | Junio C Hamano <gitster@pobox.com> | 2010-08-31 16:23:31 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-08-31 16:23:31 -0700 |
commit | 633142d86874ee8ce79a23ee4346f32e6271faad (patch) | |
tree | 8096e26f84075d3aae42d13fe0b76c2a5f2ea07c /setup.c | |
parent | 693fefe3d022767975eec7585561bfe178b873f4 (diff) | |
parent | 41bf3bc232cf5f99fdc6d3d729536a4c4821d3bd (diff) | |
download | git-633142d86874ee8ce79a23ee4346f32e6271faad.tar.gz git-633142d86874ee8ce79a23ee4346f32e6271faad.tar.xz |
Merge branch 'jn/paginate-fix'
* jn/paginate-fix:
t7006 (pager): add missing TTY prerequisites
merge-file: run setup_git_directory_gently() sooner
var: run setup_git_directory_gently() sooner
ls-remote: run setup_git_directory_gently() sooner
index-pack: run setup_git_directory_gently() sooner
config: run setup_git_directory_gently() sooner
bundle: run setup_git_directory_gently() sooner
apply: run setup_git_directory_gently() sooner
grep: run setup_git_directory_gently() sooner
shortlog: run setup_git_directory_gently() sooner
git wrapper: allow setup_git_directory_gently() be called earlier
setup: remember whether repository was found
git wrapper: introduce startup_info struct
Conflicts:
builtin/index-pack.c
Diffstat (limited to 'setup.c')
-rw-r--r-- | setup.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -426,7 +426,7 @@ static dev_t get_device_or_die(const char *path, const char *prefix) * We cannot decide in this function whether we are in the work tree or * not, since the config can only be read _after_ this function was called. */ -const char *setup_git_directory_gently(int *nongit_ok) +static const char *setup_git_directory_gently_1(int *nongit_ok) { const char *work_tree_env = getenv(GIT_WORK_TREE_ENVIRONMENT); const char *env_ceiling_dirs = getenv(CEILING_DIRECTORIES_ENVIRONMENT); @@ -507,6 +507,16 @@ const char *setup_git_directory_gently(int *nongit_ok) } } +const char *setup_git_directory_gently(int *nongit_ok) +{ + const char *prefix; + + prefix = setup_git_directory_gently_1(nongit_ok); + if (startup_info) + startup_info->have_repository = !nongit_ok || !*nongit_ok; + return prefix; +} + int git_config_perm(const char *var, const char *value) { int i; |