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

Function TestRepoCacheKey_NoRefVsExplicitRef

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

Source from the content-addressed store, hash-verified

199}
200
201func TestRepoCacheKey_NoRefVsExplicitRef(t *testing.T) {
202 t.Parallel()
203
204 // No ref (uses default branch) vs explicit ref should have DIFFERENT cache keys
205 node1, err := NewGitNode("https://github.com/foo/bar.git//file.yml", "", false)
206 require.NoError(t, err)
207
208 node2, err := NewGitNode("https://github.com/foo/bar.git//file.yml?ref=main", "", false)
209 require.NoError(t, err)
210
211 key1 := node1.repoCacheKey()
212 key2 := node2.repoCacheKey()
213
214 assert.NotEqual(t, key1, key2, "No ref and explicit ref should generate different cache keys")
215}
216
217func TestRepoCacheKey_SSHvsHTTPS(t *testing.T) {
218 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…