From b243f30f48e78d9124b4734531b4003d45f1a0f2 Mon Sep 17 00:00:00 2001 From: stk Date: Tue, 7 Feb 2023 11:45:47 +0100 Subject: [PATCH] Disable ~/.gitconfig when running integration tests A global ~/.gitconfig file can have influence on how integration tests behave; in my case, I had the option "merge.conflictStyle" set to "diff3", which made the integration test "cherry_pick_conflict" fail because the diff was different from what the test expected. Make this more robust by telling git to ignore the global config file when running tests. --- pkg/integration/components/runner.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/integration/components/runner.go b/pkg/integration/components/runner.go index 964ad98a5..2b05d102e 100644 --- a/pkg/integration/components/runner.go +++ b/pkg/integration/components/runner.go @@ -165,6 +165,8 @@ func getLazygitCommand(test *IntegrationTest, paths Paths, rootDir string, sandb cmdObj.AddEnvVars(fmt.Sprintf("KEY_PRESS_DELAY=%d", keyPressDelay)) } + cmdObj.AddEnvVars("GIT_CONFIG_GLOBAL=/dev/null") + return cmdObj.GetCmd(), nil }