(t *testing.T)
| 962 | } |
| 963 | |
| 964 | func TestClientDeleteLocalBranchReportsCheckedOutBranch(t *testing.T) { |
| 965 | // Given a repository whose trunk branch is checked out |
| 966 | repo := newTestRepo(t) |
| 967 | repo.run(t, "commit", "--quiet", "--allow-empty", "-m", "initial commit") |
| 968 | |
| 969 | // When the checked out branch is deleted |
| 970 | err := repo.client.DeleteLocalBranch(t.Context(), "trunk") |
| 971 | |
| 972 | // Then Git rejects the deletion and the branch remains |
| 973 | require.Error(t, err) |
| 974 | var gitError *GitError |
| 975 | require.ErrorAs(t, err, &gitError) |
| 976 | assert.NotZero(t, gitError.ExitCode) |
| 977 | assert.True(t, repo.client.HasLocalBranch(t.Context(), "trunk"), "checked out branch should remain") |
| 978 | } |
| 979 | |
| 980 | func TestClientHasLocalBranchFindsExistingBranch(t *testing.T) { |
| 981 | // Given a repository with a trunk commit |
nothing calls this directly
no test coverage detected