What's wrong
GitDiffBuilder (GitIntegration/Builders/GitDiffBuilder.cs, --cached added at ~L172) and GitPatchBuilder (GitIntegration/Builders/GitPatchBuilder.cs ~L428-444) add --cached and both Between revisions to the argument vector unconditionally. git rejects that combination:
git diff --cached HEAD~1 HEAD # exit 129, prints the whole `git diff` usage text
The caller gets a GitCommandException whose Message is git's full usage screen, which says nothing about which builder calls conflict.
Why it matters
The library already refuses contradictory builder combinations before running git. Examples are the checkout guard (closed #91) and the fetch AllRemotes/FromRemote guard. The comment at GitDiffBuilder.cs:88 shows the same intent for Against + Between. Staged() + Between() is the remaining gap. It is also easy to hit, since Staged() reads as an independent modifier.
Acceptance criteria
- Building or executing a diff or patch with both
Staged() and Between(a, b) throws InvalidOperationException naming the conflict. Report it the same way the checkout guard does.
Staged().Against(rev) stays allowed, since --cached <rev> is valid git.
- Fix the
Staged() XML doc, which says "against HEAD" even when Against(rev) names a different revision.
- Add tests for both builders.
Not the same as #168, which is about the trailing -- after revisions.
What's wrong
GitDiffBuilder(GitIntegration/Builders/GitDiffBuilder.cs,--cachedadded at ~L172) andGitPatchBuilder(GitIntegration/Builders/GitPatchBuilder.cs~L428-444) add--cachedand bothBetweenrevisions to the argument vector unconditionally. git rejects that combination:git diff --cached HEAD~1 HEAD # exit 129, prints the whole `git diff` usage textThe caller gets a
GitCommandExceptionwhoseMessageis git's full usage screen, which says nothing about which builder calls conflict.Why it matters
The library already refuses contradictory builder combinations before running git. Examples are the checkout guard (closed #91) and the fetch
AllRemotes/FromRemoteguard. The comment atGitDiffBuilder.cs:88shows the same intent forAgainst+Between.Staged()+Between()is the remaining gap. It is also easy to hit, sinceStaged()reads as an independent modifier.Acceptance criteria
Staged()andBetween(a, b)throwsInvalidOperationExceptionnaming the conflict. Report it the same way the checkout guard does.Staged().Against(rev)stays allowed, since--cached <rev>is valid git.Staged()XML doc, which says "against HEAD" even whenAgainst(rev)names a different revision.Not the same as #168, which is about the trailing
--after revisions.