file loss by git stash push --staged --keep-index

From: Maximilian Reichel <hidden>
Date: 2022-04-05 21:50:15

Thank you for filling out a Git bug report!
Please answer the following questions to help us understand your issue.

What did you do before the bug happened? (Steps to reproduce your issue)
Running the following script:
#!/bin/bash
git init workDir
cd workDir
git commit -m first --allow-empty
echo b > b
git add b
GIT_TRACE=TRUE git stash push --staged --keep-index
git stash pop
cat b
What did you expect to happen? (Expected behavior)
I expect file `b` to be present after running the script.
If I run the script with only `git stash push --staged` or 
`git stash push --keep-index`, the file is present afterward.

What happened instead? (Actual behavior)
The file is not present after running the script.
`cat b` will report that the file does not exist.

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help