(t *testing.T)
| 1306 | } |
| 1307 | |
| 1308 | func TestClientPullUsesAuthenticatedFastForwardOnlyCommand(t *testing.T) { |
| 1309 | // Given a client that records the Git command |
| 1310 | var gotArgs []string |
| 1311 | client := Client{GitPath: "path/to/git"} |
| 1312 | |
| 1313 | // When a remote branch is pulled |
| 1314 | err := client.Pull(t.Context(), "origin", "trunk", recordCommandArgs(t, &gotArgs)) |
| 1315 | |
| 1316 | // Then Git clears existing helpers, scopes gh credentials, and requires a fast-forward |
| 1317 | require.NoError(t, err) |
| 1318 | assert.Equal(t, []string{"path/to/git", "-c", "credential.helper=", "-c", `credential.helper=!"gh" auth git-credential`, "pull", "--ff-only", "origin", "trunk"}, gotArgs) |
| 1319 | } |
| 1320 | |
| 1321 | func TestClientPushCreatesRemoteBranchAndUpstream(t *testing.T) { |
| 1322 | // Given a local trunk branch, an empty remote, and a client defaulting to a different repository |
nothing calls this directly
no test coverage detected