(t *testing.T)
| 744 | } |
| 745 | |
| 746 | func TestClientPushDefaultPropagatesGitError(t *testing.T) { |
| 747 | // Given a client whose repository directory no longer exists |
| 748 | repo := newTestRepo(t) |
| 749 | require.NoError(t, os.RemoveAll(repo.dir)) |
| 750 | |
| 751 | // When push.default is read |
| 752 | pushDefault, err := repo.client.PushDefault(t.Context()) |
| 753 | |
| 754 | // Then the repository error is preserved |
| 755 | require.Error(t, err) |
| 756 | var gitError *GitError |
| 757 | require.ErrorAs(t, err, &gitError) |
| 758 | assert.Equal(t, 128, gitError.ExitCode) |
| 759 | assert.Empty(t, pushDefault) |
| 760 | } |
| 761 | |
| 762 | func TestClientRemotePushDefaultReturnsEmptyWhenUnset(t *testing.T) { |
| 763 | // Given a repository without remote.pushDefault |
nothing calls this directly
no test coverage detected