(t *testing.T)
| 534 | } |
| 535 | |
| 536 | func TestClientReadBranchConfigReturnsConfiguredValues(t *testing.T) { |
| 537 | // Given all supported branch configuration values set through the client |
| 538 | repo := newTestRepo(t) |
| 539 | require.NoError(t, repo.client.SetBranchConfig(t.Context(), "trunk", "remote", "upstream")) |
| 540 | require.NoError(t, repo.client.SetBranchConfig(t.Context(), "trunk", "merge", "refs/heads/trunk")) |
| 541 | require.NoError(t, repo.client.SetBranchConfig(t.Context(), "trunk", "pushremote", "origin")) |
| 542 | require.NoError(t, repo.client.SetBranchConfig(t.Context(), "trunk", MergeBaseConfig, "release")) |
| 543 | |
| 544 | // When the branch configuration is read |
| 545 | branchConfig, err := repo.client.ReadBranchConfig(t.Context(), "trunk") |
| 546 | |
| 547 | // Then the persisted configuration is returned |
| 548 | require.NoError(t, err) |
| 549 | assert.Equal(t, BranchConfig{ |
| 550 | RemoteName: "upstream", |
| 551 | PushRemoteName: "origin", |
| 552 | MergeRef: "refs/heads/trunk", |
| 553 | MergeBase: "release", |
| 554 | }, branchConfig) |
| 555 | } |
| 556 | |
| 557 | func TestClientReadBranchConfigPropagatesGitError(t *testing.T) { |
| 558 | // Given a client whose repository directory no longer exists |
nothing calls this directly
no test coverage detected