Excluding paths with wildcard not working with add -p
- From
- Robert Dailey <rcdailey.lists@gmail.com>
- Date
- May 29, 2022, 17:27 UTC
- Message-ID
- <CAHd499D81VN=aGsM6kaNLF2ZMg-Zg10U=qU-j7gQ7uXnqqfdqg@mail.gmail.com>
If I run the command:
git add -p -- ':^*.cs'
I get an error:
fatal: empty string is not a valid pathspec. please use . instead if you meant to match all paths Cannot close git diff-index --cached --numstat --summary HEAD -- :(exclude,prefix:0)*.cs () at C:/Program Files/Git/mingw64/libexec/git-core\git-add--interactive line 242.
However, it works if I remove `-p`. Also observed this works too:
git add -p -- ':*.cs'
So it looks like we have a corner case where I can't do a patch add while excluding files. Is this intentional?