MCPcopy Index your code
hub / github.com/go-task/task / TestRepoCacheKey_SameRepoSameRef

Function TestRepoCacheKey_SameRepoSameRef

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

Source from the content-addressed store, hash-verified

151}
152
153func TestRepoCacheKey_SameRepoSameRef(t *testing.T) {
154 t.Parallel()
155
156 // Same repo, same ref, different files should have SAME cache key
157 node1, err := NewGitNode("https://github.com/foo/bar.git//file1.yml?ref=main", "", false)
158 require.NoError(t, err)
159
160 node2, err := NewGitNode("https://github.com/foo/bar.git//dir/file2.yml?ref=main", "", false)
161 require.NoError(t, err)
162
163 key1 := node1.repoCacheKey()
164 key2 := node2.repoCacheKey()
165
166 assert.Equal(t, key1, key2, "Same repo+ref should generate same cache key regardless of file path")
167}
168
169func TestRepoCacheKey_SameRepoDifferentRef(t *testing.T) {
170 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…