(t *testing.T)
| 1354 | } |
| 1355 | |
| 1356 | func TestClientPushUsesAuthenticatedUpstreamCommand(t *testing.T) { |
| 1357 | // Given a client that records the Git command |
| 1358 | var gotArgs []string |
| 1359 | client := Client{GitPath: "path/to/git"} |
| 1360 | |
| 1361 | // When a branch is pushed |
| 1362 | err := client.Push(t.Context(), "origin", "trunk", recordCommandArgs(t, &gotArgs)) |
| 1363 | |
| 1364 | // Then Git clears existing helpers, scopes gh credentials, and sets the upstream |
| 1365 | require.NoError(t, err) |
| 1366 | assert.Equal(t, []string{"path/to/git", "-c", "credential.helper=", "-c", `credential.helper=!"gh" auth git-credential`, "push", "--set-upstream", "origin", "trunk"}, gotArgs) |
| 1367 | } |
| 1368 | |
| 1369 | func TestClientCloneCreatesWorkingRepositoryInModifiedRepoDir(t *testing.T) { |
| 1370 | // Given a local remote with a trunk commit and an empty destination parent |
nothing calls this directly
no test coverage detected