Sometimes `z i` causes `git stash pop --index stash@{1}`
RasmusWL opened this issue · comments
Rasmus Wriedt Larsen commented
I've experienced a few times that doing z i
(save index) causes my stash to be saved, and the previous stash to be applied instead. I can see in the logs that git stash pop --index stash@{1}
has been run.
So if the status before doing the stash is
Unstaged changes
modified foo
Staged changes
modified bar
Stashes
statsh@{0} Some Stash
After I do z i
with the message new stash
what I will see is
Staged changes
modified baz
Stashes
statsh@{0} new stash
Rasmus Wriedt Larsen commented
Aha, found out this is caused by a commit hook that failed on the intermediate commit that is made. I'll make a small PR to add --no-verify
👍