open-code-review/internal/diff
chethanuk 5c6280c8c9
Some checks are pending
CI / test (push) Waiting to run
Deploy Pages / build (push) Waiting to run
Deploy Pages / deploy (push) Blocked by required conditions
fix(diff): add --end-of-options guard and no-commit regression test for workspace diff (#376)
Follow-up to #381, which normalized the argument ordering in
workspaceTrackedDiff (options -> positional ref -> --) but stopped short of
the --end-of-options guard. This adds it before HEAD in the first runGit
call, bringing workspace mode fully in line with the canonical range/commit/
merge-base calls in this file (git.go:119/126/256), which already require
git >= 2.24.

The --staged fallback call is untouched: it has no positional ref (only the
-- pathspec separator), so --end-of-options would guard nothing there.

Also documents why the --staged fallback is load-bearing (repos with no
commits have no HEAD, so `git diff HEAD` fails while `git diff --staged`
still surfaces staged changes against the empty tree) and pins it with
TestWorkspaceDiffNoCommitsUsesStagedFallback.

Closes #374
2026-07-17 20:29:51 +08:00
..
git.go fix(diff): add --end-of-options guard and no-commit regression test for workspace diff (#376) 2026-07-17 20:29:51 +08:00
git_test.go fix(diff): add --end-of-options guard and no-commit regression test for workspace diff (#376) 2026-07-17 20:29:51 +08:00
gitignore.go feat: add ocr scan for full-file code review (#93) 2026-06-24 22:07:25 +08:00
gitignore_test.go test(diff): add tests for gitignore pattern matching and mode getters 2026-07-01 14:27:07 +08:00
hunk.go style: apply go fmt formatting 2026-06-03 17:34:28 +08:00
hunk_test.go feat: init 2026-05-20 22:03:52 +08:00
parser.go Fix workspace symlink diff containment (#125) 2026-06-15 00:03:36 +08:00
parser_test.go fix(diff): detect renamed and deleted files correctly in diff parsing (#105) 2026-06-14 22:29:02 +08:00
relocation.go Feat/telemetry http exporter (#314) 2026-07-08 13:12:21 +08:00
relocation_test.go refactor(llm): replace hand-rolled HTTP clients with official Anthropic and OpenAI SDKs 2026-06-06 19:26:34 +08:00
resolver.go fix: ensure current file path is always injected for code_comment and… (#193) 2026-06-25 16:29:09 +08:00
resolver_test.go fix: ensure current file path is always injected for code_comment and… (#193) 2026-06-25 16:29:09 +08:00
workspace_file.go Fix workspace symlink diff containment (#125) 2026-06-15 00:03:36 +08:00
workspace_file_test.go test(diff): add unit tests for readWorkspaceFileForDiff 2026-06-15 11:51:51 +08:00