You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Git diff path doesn't tolerate dangling slashes ('/') when using pathspec #5836
If I use a dangling slash ('/') in path for git diff --no-index ... <pathspec>, it fails with error fatal: `pos + len' is too far after the end of the buffer
Example:
# works:
PS C:\Users\PasiSavolainen> git diff --no-index -- C:\temp\testiconf C:\temp\t\ ':!'# fails:
PS C:\Users\PasiSavolainen> git diff --no-index -- C:\temp\testiconf C:\temp\t/':!'
fatal: `pos + len' is too far after the end of the buffer
Terminal/shell
powershell
Commands that trigger the issue
git diff --no-index -- . ./ ':!'
Expected behaviour
No error and diff shown, limited by given pathspec.
Actual behaviour
Error is shown: fatal: `pos + len' is too far after the end of the buffer
Activity
dscho commentedon Sep 23, 2025
I investigated, and this is not Windows-specific. Moving it to the Git mailing list: https://lore.kernel.org/git/c75ec5f9-407a-6555-d4fb-bb629d54ec61@gmx.de/.
dscho commentedon Sep 26, 2025
I plan on releasing Git for Windows v2.51.0(2) on this coming Monday, September 29th 2025, with a fix for this problem.
dscho commentedon Sep 26, 2025
Here is a snapshot installer/Portable Git/MinGit of this revision: https://github.com/git-for-windows/git-for-windows-automation/actions/runs/18030062242. Would you kindly confirm the fix @pasisavolainen ?
pasisavolainen commentedon Sep 28, 2025
@dscho Sorry for delay, the fix appears like it works for me, thank you!
dscho commentedon Sep 29, 2025
@pasisavolainen thanks for confirming!