From 717c3972dafa9d792a331b98a09d3cee88c17618 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= Date: Sat, 6 Feb 2010 10:35:19 +0100 Subject: setenv(GIT_DIR) clean-up This patch converts the setenv() calls in path.c and setup.c. After the call, git grep with a pager works again in bare repos. It leaves the setenv(GIT_DIR_ENVIRONMENT, ...) calls in git.c alone, as they respond to command line switches that emulate the effect of setting the environment variable directly. The remaining site in environment.c is in set_git_dir() and is left alone, too, of course. Finally, builtin-init-db.c is left changed because the repo is still being carefully constructed when the environment variable is set. This fixes git shortlog when run inside a git directory, which had been broken by abe549e1. Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano --- path.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'path.c') diff --git a/path.c b/path.c index 79aa10471..0005df3a5 100644 --- a/path.c +++ b/path.c @@ -336,7 +336,7 @@ char *enter_repo(char *path, int strict) if (access("objects", X_OK) == 0 && access("refs", X_OK) == 0 && validate_headref("HEAD") == 0) { - setenv(GIT_DIR_ENVIRONMENT, ".", 1); + set_git_dir("."); check_repository_format(); return path; } -- cgit v1.2.1