# "git-rebase -i --autostash" will leave dangling stash when editor is aborted

1 messages from 2016-06-16 to 2016-06-16. Participants: Daniel Hahler.
Thread: https://gitlist.dev/t/42621

## Daniel Hahler, 2016-06-15 21:56

Subject: "git-rebase -i --autostash" will leave dangling stash when editor is aborted
Message-ID: <1b5e2f4b-7a3d-7554-3aa0-79231bee039e@thequod.de>
URL: https://gitlist.dev/e/1b5e2f4b-7a3d-7554-3aa0-79231bee039e%40thequod.de

```
TEST CASE:

1. Modify a file that need to get stashed on rebasing
2. Run "EDITOR=vim git rebase -i --autostash"
3. Abort with ":cq", which will make Vim exit non-zero

Git then will create an autostash, but aborts with "Could not execute
editor", via the following code in git-rebase--interactive.sh, and does
not restore the autostash - it does not show up with the regular
stashes, like when there is a conflict during the rebase:

    git_sequence_editor "$todo" ||
        die_abort "Could not execute editor"

Step 2 and 3 and probably merged into a single one for a test case, but
that's how I keep triggering it.

Instead of adding it to the list of stashes, it should probably get
restored/re-applied right away, since no rebase actions have been triggered.


Please CC me in replies.


Cheers,
Daniel.

```
