mirror of
https://github.com/alibaba/open-code-review.git
synced 2026-07-31 12:04:37 +00:00
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 |
||
|---|---|---|
| .. | ||
| git.go | ||
| git_test.go | ||
| gitignore.go | ||
| gitignore_test.go | ||
| hunk.go | ||
| hunk_test.go | ||
| parser.go | ||
| parser_test.go | ||
| relocation.go | ||
| relocation_test.go | ||
| resolver.go | ||
| resolver_test.go | ||
| workspace_file.go | ||
| workspace_file_test.go | ||