Fix cherry pick preview (#218)

The preview on cherry pick was accidentally broken since we included the
+/- information in the commit list. Fix this by using the correct string
index.
This commit is contained in:
Tim 2022-07-14 18:24:56 +02:00 committed by GitHub
parent d2c2848037
commit fdd5632b17
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -340,7 +340,7 @@ function forgit::cherry::pick -d "git cherry-picking" --argument-names 'target'
echo "Please specify target branch"
return 1
end
set preview "echo {1} | xargs -I% git show --color=always % | $forgit_show_pager"
set preview "echo {2} | xargs -I% git show --color=always % | $forgit_show_pager"
set opts "
--preview=\"$preview\"
$FORGIT_FZF_DEFAULT_OPTS

View file

@ -154,7 +154,7 @@ forgit::cherry::pick() {
base=$(git branch --show-current)
[[ -z $1 ]] && echo "Please specify target branch" && return 1
target="$1"
preview="echo {1} | xargs -I% git show --color=always % | $forgit_show_pager"
preview="echo {2} | xargs -I% git show --color=always % | $forgit_show_pager"
opts="
$FORGIT_FZF_DEFAULT_OPTS
--preview=\"$preview\"