From 24fcae02c33ca0fb05b088d55d12bf97fa2c23f3 Mon Sep 17 00:00:00 2001 From: Steffen Prohaska Date: Tue, 1 Jan 2008 20:34:52 +0100 Subject: [PATCH] Revert replacing setenv() with set_git_dir() This partially reverts commit 855f254b2b5b083a63fc8d7709a42e2cbdc5a136. All tests still pass after this revert. The original commit seems unnecessary. Signed-off-by: Steffen Prohaska --- git.c | 6 +++--- path.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/git.c b/git.c index 5ae18e926f..327215cc91 100644 --- a/git.c +++ b/git.c @@ -45,14 +45,14 @@ static int handle_options(const char*** argv, int* argc, int* envchanged) fprintf(stderr, "No directory given for --git-dir.\n" ); usage(git_usage_string); } - set_git_dir( (*argv)[1] ); + setenv(GIT_DIR_ENVIRONMENT, (*argv)[1], 1); if (envchanged) *envchanged = 1; (*argv)++; (*argc)--; handled++; } else if (!prefixcmp(cmd, "--git-dir=")) { - set_git_dir(cmd + 10); + setenv(GIT_DIR_ENVIRONMENT, cmd + 10, 1); if (envchanged) *envchanged = 1; } else if (!strcmp(cmd, "--work-tree")) { @@ -72,7 +72,7 @@ static int handle_options(const char*** argv, int* argc, int* envchanged) } else if (!strcmp(cmd, "--bare")) { static char git_dir[PATH_MAX+1]; is_bare_repository_cfg = 1; - set_git_dir(getcwd(git_dir, sizeof(git_dir))); + setenv(GIT_DIR_ENVIRONMENT, getcwd(git_dir, sizeof(git_dir)), 0); if (envchanged) *envchanged = 1; } else { diff --git a/path.c b/path.c index 4e19c4cdaa..fe0361aab4 100644 --- a/path.c +++ b/path.c @@ -255,7 +255,7 @@ char *enter_repo(char *path, int strict) if (access("objects", X_OK) == 0 && access("refs", X_OK) == 0 && validate_headref("HEAD") == 0) { - set_git_dir("."); + setenv(GIT_DIR_ENVIRONMENT, ".", 1); check_repository_format(); return path; }