From fdd5632b171f6bfef5e43b41b647dd8ec1fc05d6 Mon Sep 17 00:00:00 2001 From: Tim <45259958+carlfriedrich@users.noreply.github.com> Date: Thu, 14 Jul 2022 18:24:56 +0200 Subject: [PATCH] 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. --- conf.d/forgit.plugin.fish | 2 +- forgit.plugin.zsh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/conf.d/forgit.plugin.fish b/conf.d/forgit.plugin.fish index 1845d54..82c7f3e 100644 --- a/conf.d/forgit.plugin.fish +++ b/conf.d/forgit.plugin.fish @@ -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 diff --git a/forgit.plugin.zsh b/forgit.plugin.zsh index 5c11806..cb61217 100755 --- a/forgit.plugin.zsh +++ b/forgit.plugin.zsh @@ -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\"