Summary
GitHelperTests.GetChangedFilesFromCommit_FailsWhenGitCommandTimesOut consistently fails on current origin/main under net8.0. The fake git used by the test returns a fixed hash for rev-parse --verify, while ValidateSingleCommitRef now requires the resolved hash to match the requested temporary commit. Validation therefore throws ArgumentException before the fake diff-tree process can exercise the intended timeout path.
Reproduction
dotnet test tests/CodeIndex.Tests/CodeIndex.Tests.csproj -c Release -f net8.0 --filter FullyQualifiedName~GetChangedFilesFromCommit_FailsWhenGitCommandTimesOut --no-build --no-restore
Expected: the test reaches diff-tree and observes the bounded timeout as InvalidOperationException.
Actual: Invalid commit ID ... Git could not resolve it to a single commit is raised as ArgumentException.
Acceptance criteria
- The fake git validation response remains consistent with the temporary commit passed by the test.
- The test reaches the
diff-tree timeout path and verifies that the child process is reaped.
- Production single-commit validation remains strict.
Summary
GitHelperTests.GetChangedFilesFromCommit_FailsWhenGitCommandTimesOutconsistently fails on currentorigin/mainundernet8.0. The fake git used by the test returns a fixed hash forrev-parse --verify, whileValidateSingleCommitRefnow requires the resolved hash to match the requested temporary commit. Validation therefore throwsArgumentExceptionbefore the fakediff-treeprocess can exercise the intended timeout path.Reproduction
dotnet test tests/CodeIndex.Tests/CodeIndex.Tests.csproj -c Release -f net8.0 --filter FullyQualifiedName~GetChangedFilesFromCommit_FailsWhenGitCommandTimesOut --no-build --no-restoreExpected: the test reaches
diff-treeand observes the bounded timeout asInvalidOperationException.Actual:
Invalid commit ID ... Git could not resolve it to a single commitis raised asArgumentException.Acceptance criteria
diff-treetimeout path and verifies that the child process is reaped.