mirror of
https://github.com/git/git.git
synced 2026-03-13 10:23:30 +01:00
Revert replacing setenv() with set_git_dir()
This partially reverts commit
855f254b2b. All tests still
pass after this revert. The original commit seems unnecessary.
Signed-off-by: Steffen Prohaska <prohaska@zib.de>
This commit is contained in:
6
git.c
6
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 {
|
||||
|
||||
Reference in New Issue
Block a user