(t *testing.T)
| 1238 | } |
| 1239 | |
| 1240 | func TestClientFetchUsesAuthenticatedCommand(t *testing.T) { |
| 1241 | // Given a client that records the Git command |
| 1242 | var gotArgs []string |
| 1243 | client := Client{GitPath: "path/to/git"} |
| 1244 | |
| 1245 | // When a remote branch is fetched |
| 1246 | err := client.Fetch(t.Context(), "origin", "trunk", recordCommandArgs(t, &gotArgs)) |
| 1247 | |
| 1248 | // Then Git clears existing helpers and scopes gh credentials to all hosts |
| 1249 | require.NoError(t, err) |
| 1250 | assert.Equal(t, []string{"path/to/git", "-c", "credential.helper=", "-c", `credential.helper=!"gh" auth git-credential`, "fetch", "origin", "trunk"}, gotArgs) |
| 1251 | } |
| 1252 | |
| 1253 | func TestClientPullFastForwardsCurrentBranch(t *testing.T) { |
| 1254 | // Given a local branch behind its remote and a client defaulting to a different repository |
nothing calls this directly
no test coverage detected