Skip to content

Commit 20527c1

Browse files
committed
Filter out GIT_INDEX_FILE from cloner environment variables
1 parent b4907c4 commit 20527c1

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

private/pkg/git/cloner.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,12 @@ func (c *cloner) CloneToBucket(
7777
depthArg := strconv.Itoa(int(depth))
7878

7979
envContainer = app.NewEnvContainerWithOverrides(envContainer, map[string]string{
80-
// In the case where this is being run in an environment where GIT_DIR is set, e.g. within
81-
// a submodule, we want to treat this as a stand-alone clone rather than interacting with
82-
// an existing GIT_DIR. So we filter out GIT_DIR from our environment variables.
83-
"GIT_DIR": "",
80+
// In the case where this is being run in an environment where GIT_DIR and GIT_INDEX_FILE
81+
// are set, e.g. within a submodule, we want to treat this as a stand-alone, non-bare
82+
// clone rather than interacting with an existing GIT_DIR and GIT_INDEX_FILE.
83+
// So we filter out GIT_DIR and GIT_INDEX_FILE from our environment variables.
84+
"GIT_DIR": "",
85+
"GIT_INDEX_FILE": "",
8486
})
8587

8688
baseDir, err := tmp.NewDir(ctx)

0 commit comments

Comments
 (0)