MCPcopy Create free account
hub / github.com/cli/cli / TestClientPathFromRootReturnsEmptyOutsideRepository

Function TestClientPathFromRootReturnsEmptyOutsideRepository

git/client_test.go:1136–1146  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1134}
1135
1136func TestClientPathFromRootReturnsEmptyOutsideRepository(t *testing.T) {
1137 // Given a client outside a Git repository
1138 IsolateConfig(t)
1139 client := Client{RepoDir: t.TempDir()}
1140
1141 // When its path relative to a repository root is requested
1142 dir := client.PathFromRoot(t.Context())
1143
1144 // Then no path is returned
1145 assert.Empty(t, dir)
1146}
1147
1148func TestClientUnsetRemoteResolutionRemovesResolution(t *testing.T) {
1149 // Given a repository with a resolved remote

Callers

nothing calls this directly

Calls 3

PathFromRootMethod · 0.95
IsolateConfigFunction · 0.85
EmptyMethod · 0.80

Tested by

no test coverage detected