MCPcopy Create free account
hub / github.com/github/gh-aw / TestFetchRefToRefspec

Function TestFetchRefToRefspec

pkg/workflow/checkout_manager_test.go:875–892  ·  view source on GitHub ↗

TestFetchRefToRefspec verifies the refspec expansion logic.

(t *testing.T)

Source from the content-addressed store, hash-verified

873
874// TestFetchRefToRefspec verifies the refspec expansion logic.
875func TestFetchRefToRefspec(t *testing.T) {
876 tests := []struct {
877 pattern string
878 expected string
879 }{
880 {"*", "+refs/heads/*:refs/remotes/origin/*"},
881 {"refs/pulls/open/*", "+refs/pull/*/head:refs/remotes/origin/pull/*/head"},
882 {"main", "+refs/heads/main:refs/remotes/origin/main"},
883 {"feature/my-branch", "+refs/heads/feature/my-branch:refs/remotes/origin/feature/my-branch"},
884 {"feature/*", "+refs/heads/feature/*:refs/remotes/origin/feature/*"},
885 }
886 for _, tt := range tests {
887 t.Run(tt.pattern, func(t *testing.T) {
888 got := fetchRefToRefspec(tt.pattern)
889 assert.Equal(t, tt.expected, got, "refspec should match expected value")
890 })
891 }
892}
893
894// TestMergeFetchRefs verifies that fetch ref lists are properly unioned.
895func TestMergeFetchRefs(t *testing.T) {

Callers

nothing calls this directly

Calls 2

fetchRefToRefspecFunction · 0.85
RunMethod · 0.45

Tested by

no test coverage detected