kahole / edamagit

Magit for VSCode

Home Page:https://marketplace.visualstudio.com/items?itemName=kahole.magit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sometimes `z i` causes `git stash pop --index stash@{1}`

RasmusWL opened this issue · comments

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

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 👍