The -- separator is optional, but always providing it helps avoid arguments being ambiguous in some situations.
Below is an example of when the head commit does not exist.
Before:
exec `git log` failed: exit status 128. Output was:
fatal: ambiguous argument 'notexist': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
After:
exec `git log` failed: exit status 128. Output was:
fatal: bad revision 'notexist'
The new error is better because we can map it to vcs.ErrCommitNotFound rather than a generic unknown error type. This is left for a future PR.
The
--
separator is optional, but always providing it helps avoid arguments being ambiguous in some situations.Below is an example of when the head commit does not exist.
Before:
After:
The new error is better because we can map it to
vcs.ErrCommitNotFound
rather than a generic unknown error type. This is left for a future PR.