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

Function TestClientPushDefaultReturnsConfiguredValue

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

Source from the content-addressed store, hash-verified

731}
732
733func TestClientPushDefaultReturnsConfiguredValue(t *testing.T) {
734 // Given a repository configured to push the current branch
735 repo := newTestRepo(t)
736 repo.run(t, "config", "push.default", "current")
737
738 // When push.default is read
739 pushDefault, err := repo.client.PushDefault(t.Context())
740
741 // Then the configured behavior is returned
742 require.NoError(t, err)
743 assert.Equal(t, PushDefaultCurrent, pushDefault)
744}
745
746func TestClientPushDefaultPropagatesGitError(t *testing.T) {
747 // Given a client whose repository directory no longer exists

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected