[bug] incorrect pathspec handling in git stash error message

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



=====
===== What did you do before the bug happened? (Steps to reproduce your issue)
=====
Here is how to reproduce the issue from scratch:
1. mkdir testrepo
2. cd testrepo
3. git init
4. touch testfile
5. git stash push testfile

=====
===== What did you expect to happen? (Expected behavior)
=====
Because 'testfile' is untracked, I expected an error message similar to this:
    testrepo $ git checkout testfile
    error: pathspec 'testfile' did not match any file(s) known to git

=====
===== What happened instead? (Actual behavior)
=====
This is what happens instead:
    testrepo $ git stash push testfile
    error: pathspec ':(prefix:0)testfile' did not match any file(s) known to git
    Did you forget to 'git add'?

=====
===== What's different between what you expected and what actually happened?
=====
Looks like the magic prefix is handled incorrectly in git stash error messages.

=========================
=========================
[System Info]
git version:
git version 2.47.1
cpu: arm64
no commit associated with this build
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
feature: fsmonitor--daemon
libcurl: 8.6.0
zlib: 1.2.12
uname: Darwin 23.6.0 Darwin Kernel Version 23.6.0: Thu Sep 12 23:34:49 PDT 2024
compiler info: clang: 16.0.0 (clang-1600.0.26.4)
libc info: no libc information available
$SHELL (typically, interactive shell): /bin/zsh
=========================
=========================




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux