submodule: avoid auto-discovery in new working tree manipulator code
All commands that are run in a submodule, are run in a correct setup,
there is no need to prepare the environment without setting the GIT_DIR
variable. By setting the GIT_DIR variable we fix issues as discussed in
10f5c52656
(submodule: avoid auto-discovery in
prepare_submodule_repo_env(), 2016-09-01)
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
a17062cf42
commit
da27bc81f0
@ -1363,7 +1363,7 @@ static int submodule_has_dirty_index(const struct submodule *sub)
|
|||||||
{
|
{
|
||||||
struct child_process cp = CHILD_PROCESS_INIT;
|
struct child_process cp = CHILD_PROCESS_INIT;
|
||||||
|
|
||||||
prepare_submodule_repo_env_no_git_dir(&cp.env_array);
|
prepare_submodule_repo_env(&cp.env_array);
|
||||||
|
|
||||||
cp.git_cmd = 1;
|
cp.git_cmd = 1;
|
||||||
argv_array_pushl(&cp.args, "diff-index", "--quiet",
|
argv_array_pushl(&cp.args, "diff-index", "--quiet",
|
||||||
@ -1380,7 +1380,7 @@ static int submodule_has_dirty_index(const struct submodule *sub)
|
|||||||
static void submodule_reset_index(const char *path)
|
static void submodule_reset_index(const char *path)
|
||||||
{
|
{
|
||||||
struct child_process cp = CHILD_PROCESS_INIT;
|
struct child_process cp = CHILD_PROCESS_INIT;
|
||||||
prepare_submodule_repo_env_no_git_dir(&cp.env_array);
|
prepare_submodule_repo_env(&cp.env_array);
|
||||||
|
|
||||||
cp.git_cmd = 1;
|
cp.git_cmd = 1;
|
||||||
cp.no_stdin = 1;
|
cp.no_stdin = 1;
|
||||||
@ -1438,7 +1438,7 @@ int submodule_move_head(const char *path,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
prepare_submodule_repo_env_no_git_dir(&cp.env_array);
|
prepare_submodule_repo_env(&cp.env_array);
|
||||||
|
|
||||||
cp.git_cmd = 1;
|
cp.git_cmd = 1;
|
||||||
cp.no_stdin = 1;
|
cp.no_stdin = 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user