MCPcopy
hub / github.com/go-task/task / TestRepoCacheKey_SSHvsHTTPS

Function TestRepoCacheKey_SSHvsHTTPS

taskfile/node_git_test.go:217–232  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

215}
216
217func TestRepoCacheKey_SSHvsHTTPS(t *testing.T) {
218 t.Parallel()
219
220 // SSH vs HTTPS pointing to same repo should have SAME cache key
221 // They clone the same repo, so we want to share the cache
222 node1, err := NewGitNode("git@github.com:foo/bar.git//file.yml?ref=main", "", false)
223 require.NoError(t, err)
224
225 node2, err := NewGitNode("https://github.com/foo/bar.git//file.yml?ref=main", "", false)
226 require.NoError(t, err)
227
228 key1 := node1.repoCacheKey()
229 key2 := node2.repoCacheKey()
230
231 assert.Equal(t, key1, key2, "SSH and HTTPS for same repo should share cache")
232}
233
234func TestRepoCacheKey_Consistency(t *testing.T) {
235 t.Parallel()

Callers

nothing calls this directly

Calls 2

repoCacheKeyMethod · 0.95
NewGitNodeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…