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 <ilancosman@gmail.com>
This commit is contained in:
Illia Bobyr 2023-07-29 15:33:30 -07:00 committed by GitHub
parent 3b1137b4b3
commit 90ca78b09c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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