For example, in VSCode, when doing 'Stage Selected Ranges' a newline is present in the sha1 argument to git update-index, which cause the last argument to be interpreted as a new command:
> git hash-object --stdin -w --path readme.txt
> git ls-tree -l HEAD -- readme.txt
> git update-index --cacheinfo 100644 34d84665cf8b0b17044053c861f3bbbf06590033
readme.txt
error: option 'cacheinfo' expects <mode>,<sha1>,<path>
usage: git update-index [<options>] [--] [<file>...]
-q continue refresh even when index needs update
[...]
--no-fsmonitor-valid clear fsmonitor valid bit
/bin/bash: line 1: readme.txt: command not found
(The newline is actually coming from the output of git hash-object, so it is not a VSCode problem.)
For example, in VSCode, when doing 'Stage Selected Ranges' a newline is present in the sha1 argument to
git update-index
, which cause the last argument to be interpreted as a new command:(The newline is actually coming from the output of
git hash-object
, so it is not a VSCode problem.)