Skip to content

Commit 48f7459

Browse files
committed
fix(git): fix Windows path separator mismatch in TestSetUserNative
fileContent() always joins folder+"/"+file, regardless of OS, but the test built its mock's expected key with filepath.Join, which uses backslashes on Windows. That mismatch made the mock call unexpected on the windows-latest CI runner. Build the expected key the same way fileContent() does.
1 parent 73e7608 commit 48f7459

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/segments/git_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2368,7 +2368,7 @@ func TestSetUserNative(t *testing.T) {
23682368
// no RunCommand expectation at all, proves setUser reads the local
23692369
// config without ever spawning git.
23702370
env := new(mock.Environment)
2371-
env.On("FileContent", filepath.Join(gitDir, "config")).Return(string(configData))
2371+
env.On("FileContent", gitDir+"/config").Return(string(configData))
23722372

23732373
g := &Git{mainSCMDir: gitDir}
23742374
g.Init(options.Map{}, env)

0 commit comments

Comments
 (0)