From 50eecf7e013e1a0a173ea1f4080598807d769139 Mon Sep 17 00:00:00 2001 From: Julian Prein Date: Tue, 18 Jul 2023 14:33:55 +0200 Subject: [PATCH] git:perm-stash: Use stash's ancestor as commit_ref The stash does not necessarily apply to HEAD. --- .config/zsh/autoload/git/git-perm-stash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/zsh/autoload/git/git-perm-stash b/.config/zsh/autoload/git/git-perm-stash index b90c093..4132355 100755 --- a/.config/zsh/autoload/git/git-perm-stash +++ b/.config/zsh/autoload/git/git-perm-stash @@ -11,7 +11,7 @@ git rev-parse idx="${1:-0}" stash_ref="$(git rev-parse stash@{$idx} | cut -c-$REF_LEN)" -commit_ref="$(git rev-parse HEAD | cut -c-$REF_LEN)" +commit_ref="$(git rev-parse stash@{$idx}~ | cut -c-$REF_LEN)" git stash show -up "$idx" > \ "${2:-$DIR}/${PWD//\//__}__${commit_ref}__$stash_ref.diff"