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

Function TestResolveLatestRef_BranchIntegration

pkg/cli/update_integration_test.go:127–136  ·  view source on GitHub ↗

TestResolveLatestRef_BranchIntegration verifies that a branch name resolves to the latest commit SHA for that branch.

(t *testing.T)

Source from the content-addressed store, hash-verified

125// TestResolveLatestRef_BranchIntegration verifies that a branch name resolves
126// to the latest commit SHA for that branch.
127func TestResolveLatestRef_BranchIntegration(t *testing.T) {
128 skipWithoutGitHubAuth(t)
129
130 // Use a well-known branch on a public repo
131 latestRef, err := resolveLatestRef(context.Background(), "actions/checkout", "main", false, true, 0)
132 require.NoError(t, err, "Should resolve latest commit for branch 'main'")
133
134 // The result should be a 40-char commit SHA
135 assert.True(t, IsCommitSHA(latestRef), "Branch resolution should return a commit SHA, got: %s", latestRef)
136}
137
138// TestResolveLatestRef_CommitSHAIntegration verifies that a commit SHA resolves
139// to the latest commit from the default branch.

Callers

nothing calls this directly

Calls 4

skipWithoutGitHubAuthFunction · 0.85
resolveLatestRefFunction · 0.85
IsCommitSHAFunction · 0.85
BackgroundMethod · 0.80

Tested by

no test coverage detected