From 6b4df330e1e341b60dfae9c456056aa772368404 Mon Sep 17 00:00:00 2001 From: ray-x Date: Thu, 10 Jun 2021 12:53:14 +1000 Subject: [PATCH] Bugfix: gd(git diff) for fish does not work with arguments --- conf.d/forgit.plugin.fish | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/conf.d/forgit.plugin.fish b/conf.d/forgit.plugin.fish index 602d550..e72e3ad 100644 --- a/conf.d/forgit.plugin.fish +++ b/conf.d/forgit.plugin.fish @@ -59,11 +59,11 @@ function forgit::log -d "git commit viewer" end ## git diff viewer -function forgit::diff -d "git diff viewer" +function forgit::diff -d "git diff viewer" forgit::inside_work_tree || return 1 if count $argv > /dev/null - if git rev-parse "$1" > /dev/null 2>&1 - set commit "$1" && set files "$2" + if git rev-parse "$argv[1]" > /dev/null 2>&1 + set commit "$argv[1]" && set files "$argv[2..]" else set files "$argv" end @@ -228,7 +228,7 @@ function forgit::checkout::branch -d "git checkout branch selector" --argument-n set opts " $FORGIT_FZF_DEFAULT_OPTS - +s +m --tiebreak=index + +s +m --tiebreak=index $FORGIT_CHECKOUT_BRANCH_FZF_OPTS " eval "$cmd" | env FZF_DEFAULT_OPTS="$opts" fzf --preview="$preview" | xargs -I% git checkout %