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>
Stefan Beller committed
May 2, 2017 at 12:32 UTC
da27bc81f00fb5315341b26db8879c266e8ba1a2
1 file changed
+3
-3
submodule.c
+3
-3
@@ -1363,7 +1363,7 @@ static int submodule_has_dirty_index(const struct submodule *sub)
1363
{
1364
struct child_process cp = CHILD_PROCESS_INIT;
1365
1366
- prepare_submodule_repo_env_no_git_dir(&cp.env_array);
1366
+ prepare_submodule_repo_env(&cp.env_array);
1367
1368
cp.git_cmd = 1;
1369
argv_array_pushl(&cp.args, "diff-index", "--quiet",
@@ -1380,7 +1380,7 @@ static int submodule_has_dirty_index(const struct submodule *sub)
1380
static void submodule_reset_index(const char *path)
1381
{
1382
struct child_process cp = CHILD_PROCESS_INIT;
1383
- prepare_submodule_repo_env_no_git_dir(&cp.env_array);
1383
+ prepare_submodule_repo_env(&cp.env_array);
1384
1385
cp.git_cmd = 1;
1386
cp.no_stdin = 1;
@@ -1438,7 +1438,7 @@ int submodule_move_head(const char *path,
1438
}
1439
}
1440
1441
- prepare_submodule_repo_env_no_git_dir(&cp.env_array);
1441
+ prepare_submodule_repo_env(&cp.env_array);
1442
1443
cp.git_cmd = 1;
1444
cp.no_stdin = 1;