{"thread":{"id":"62564","subject":"[bug] incorrect pathspec handling in git stash error message","startedAt":"2024-11-29T11:46:59Z","lastAt":"2024-11-29T11:46:59Z","messageCount":1,"participants":["Tamas Dina"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"508324","messageId":"CAMZfs4Vfi4OfuO3=7yT=ge7MHXf1iPhZjeJSzgnr=9oQFiRKjg@mail.gmail.com","threadId":"62564","inReplyTo":null,"subject":"[bug] incorrect pathspec handling in git stash error message","fromName":"Tamas Dina","fromEmail":"dinatamaspal.throwaway1@gmail.com","sentAt":"2024-11-29T11:46:48Z","receivedAt":"2024-11-29T11:46:59Z","isPatch":false,"sender":{"key":"dinatamaspal.throwaway1@gmail.com","avatar":null},"body":"=====\n===== What did you do before the bug happened? (Steps to reproduce your issue)\n=====\nHere is how to reproduce the issue from scratch:\n1. mkdir testrepo\n2. cd testrepo\n3. git init\n4. touch testfile\n5. git stash push testfile\n\n=====\n===== What did you expect to happen? (Expected behavior)\n=====\nBecause 'testfile' is untracked, I expected an error message similar to this:\n    testrepo $ git checkout testfile\n    error: pathspec 'testfile' did not match any file(s) known to git\n\n=====\n===== What happened instead? (Actual behavior)\n=====\nThis is what happens instead:\n    testrepo $ git stash push testfile\n    error: pathspec ':(prefix:0)testfile' did not match any file(s) known to git\n    Did you forget to 'git add'?\n\n=====\n===== What's different between what you expected and what actually happened?\n=====\nLooks like the magic prefix is handled incorrectly in git stash error messages.\n\n=========================\n=========================\n[System Info]\ngit version:\ngit version 2.47.1\ncpu: arm64\nno commit associated with this build\nsizeof-long: 8\nsizeof-size_t: 8\nshell-path: /bin/sh\nfeature: fsmonitor--daemon\nlibcurl: 8.6.0\nzlib: 1.2.12\nuname: Darwin 23.6.0 Darwin Kernel Version 23.6.0: Thu Sep 12 23:34:49 PDT 2024\ncompiler info: clang: 16.0.0 (clang-1600.0.26.4)\nlibc info: no libc information available\n$SHELL (typically, interactive shell): /bin/zsh\n=========================\n=========================\n"}]}