git:perm-stash: Use stash's ancestor as commit_ref
The stash does not necessarily apply to HEAD.
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user