Skip to content
This repository was archived by the owner on Sep 9, 2020. It is now read-only.

Commit a437df4

Browse files
authored
Merge pull request #1868 from sigma/pr/fix-rebase-exec
test: unset GIT_DIR for git operations in integration tests
2 parents f26ae76 + afa687f commit a437df4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Diff for: internal/test/integration/testproj.go

+7
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ type TestProject struct {
4242

4343
// NewTestProject initializes a new test's project directory.
4444
func NewTestProject(t *testing.T, initPath, wd string, run RunFunc) *TestProject {
45+
// Cleaning up the GIT_DIR variable is useful when running tests under git
46+
// rebase. In any case, since we're operating with temporary clones,
47+
// no pre-existing value could be useful here.
48+
// We do it globally because the internal runs don't actually use the
49+
// TestProject's environment.
50+
os.Unsetenv("GIT_DIR")
51+
4552
new := &TestProject{
4653
t: t,
4754
origWd: wd,

0 commit comments

Comments
 (0)