(t *testing.T)
| 1046 | } |
| 1047 | |
| 1048 | func TestClientCheckoutNewBranchReportsMissingTrackingBranch(t *testing.T) { |
| 1049 | // Given a repository without the requested remote tracking branch |
| 1050 | repo := newTestRepo(t) |
| 1051 | |
| 1052 | // When a local branch is created from it |
| 1053 | err := repo.client.CheckoutNewBranch(t.Context(), "origin", "missing") |
| 1054 | |
| 1055 | // Then Git's checkout error is returned and no branch is created |
| 1056 | require.Error(t, err) |
| 1057 | var gitError *GitError |
| 1058 | require.ErrorAs(t, err, &gitError) |
| 1059 | assert.NotZero(t, gitError.ExitCode) |
| 1060 | assert.False(t, repo.client.HasLocalBranch(t.Context(), "missing"), "failed checkout should not create a branch") |
| 1061 | } |
| 1062 | |
| 1063 | func TestClientToplevelDirReturnsRepositoryRootFromSubdirectory(t *testing.T) { |
| 1064 | // Given a client operating from a nested repository directory |
nothing calls this directly
no test coverage detected