MCPcopy Create free account
hub / github.com/cli/cli / TestClientPushRevisionReportsUnresolvedBranch

Function TestClientPushRevisionReportsUnresolvedBranch

git/client_test.go:824–837  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

822}
823
824func TestClientPushRevisionReportsUnresolvedBranch(t *testing.T) {
825 // Given a repository without the requested branch
826 repo := newTestRepo(t)
827
828 // When its push revision is resolved
829 trackingRef, err := repo.client.PushRevision(t.Context(), "missing")
830
831 // Then Git's revision error is returned
832 require.Error(t, err)
833 var gitError *GitError
834 require.ErrorAs(t, err, &gitError)
835 assert.NotZero(t, gitError.ExitCode)
836 assert.Empty(t, trackingRef)
837}
838
839func TestParsePushRevisionReportsMalformedSymbolicRef(t *testing.T) {
840 // Given Git returns a symbolic push ref outside refs/remotes

Callers

nothing calls this directly

Calls 4

newTestRepoFunction · 0.85
EmptyMethod · 0.80
PushRevisionMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected