(t *testing.T)
| 85 | } |
| 86 | |
| 87 | func TestGoGit_DetectsSubmodules(t *testing.T) { |
| 88 | repo := CreateGoGitTestRepo(t, false) |
| 89 | expected := filepath.Join(goGitRepoDir(t, repo), "/.git") |
| 90 | |
| 91 | d := t.TempDir() |
| 92 | err := os.WriteFile(filepath.Join(d, ".git"), []byte(fmt.Sprintf("gitdir: %s", expected)), 0600) |
| 93 | require.NoError(t, err) |
| 94 | |
| 95 | result, err := detectGitPath(d, 0) |
| 96 | assert.Empty(t, err) |
| 97 | assert.Equal(t, expected, result) |
| 98 | } |
nothing calls this directly
no test coverage detected