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

Function TestClientRemotePushDefaultReturnsConfiguredRemote

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

Source from the content-addressed store, hash-verified

772}
773
774func TestClientRemotePushDefaultReturnsConfiguredRemote(t *testing.T) {
775 // Given a repository with a preferred push remote
776 repo := newTestRepo(t)
777 repo.run(t, "config", "remote.pushDefault", "origin")
778
779 // When remote.pushDefault is read
780 remote, err := repo.client.RemotePushDefault(t.Context())
781
782 // Then the configured remote is returned
783 require.NoError(t, err)
784 assert.Equal(t, "origin", remote)
785}
786
787func TestClientRemotePushDefaultPropagatesGitError(t *testing.T) {
788 // Given a client whose repository directory no longer exists

Callers

nothing calls this directly

Calls 4

newTestRepoFunction · 0.85
EqualMethod · 0.80
RemotePushDefaultMethod · 0.65
runMethod · 0.45

Tested by

no test coverage detected