From 90ca78b09c8619af0fa0795b8d321cdf9a242956 Mon Sep 17 00:00:00 2001 From: Illia Bobyr Date: Sat, 29 Jul 2023 15:33:30 -0700 Subject: [PATCH] Skip rebase/cherry-pick progress when it is absent (#425) * Skip rebase/cherry-pick progress when absent In particular, it might not be present when preparing a rebase plan, via an interactive rebase command. * My styling --------- Co-authored-by: Ilan Cosman --- functions/_tide_item_git.fish | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/functions/_tide_item_git.fish b/functions/_tide_item_git.fish index c419695..3154acc 100644 --- a/functions/_tide_item_git.fish +++ b/functions/_tide_item_git.fish @@ -14,12 +14,17 @@ function _tide_item_git # Operation if test -d $gdir/rebase-merge - read -f step <$gdir/rebase-merge/msgnum - read -f total_steps <$gdir/rebase-merge/end + # Turn ANY into ALL, via double negation + if not path is -v $gdir/rebase-merge/{msgnum,end} + read -f step <$gdir/rebase-merge/msgnum + read -f total_steps <$gdir/rebase-merge/end + end test -f $gdir/rebase-merge/interactive && set -f operation rebase-i || set -f operation rebase-m else if test -d $gdir/rebase-apply - read -f step <$gdir/rebase-apply/next - read -f total_steps <$gdir/rebase-apply/last + if not path is -v $gdir/rebase-apply/{next,last} + read -f step <$gdir/rebase-apply/next + read -f total_steps <$gdir/rebase-apply/last + end if test -f $gdir/rebase-apply/rebasing set -f operation rebase else if test -f $gdir/rebase-apply/applying