aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--share/functions/__fish_git_prompt.fish21
1 files changed, 16 insertions, 5 deletions
diff --git a/share/functions/__fish_git_prompt.fish b/share/functions/__fish_git_prompt.fish
index 333267a3..c58ed37a 100644
--- a/share/functions/__fish_git_prompt.fish
+++ b/share/functions/__fish_git_prompt.fish
@@ -447,16 +447,23 @@ function __fish_git_prompt_operation_branch_bare --description "__fish_git_promp
set -l operation
set -l detached no
set -l bare
+ set -l step
+ set -l total
set -l os
- if test -f $git_dir/rebase-merge/interactive
- set operation "|REBASE-i"
- set branch (cat $git_dir/rebase-merge/head-name ^/dev/null)
- else if test -d $git_dir/rebase-merge
- set operation "|REBASE-m"
+ if test -d $git_dir/rebase-merge
set branch (cat $git_dir/rebase-merge/head-name ^/dev/null)
+ set step (cat $git_dir/rebase-merge/msgnum ^/dev/null)
+ set total (cat $git_dir/rebase-merge/end ^/dev/null)
+ if test -f $git_dir/rebase-merge/interactive
+ set operation "|REBASE-i"
+ else
+ set operation "|REBASE-m"
+ end
else
if test -d $git_dir/rebase-apply
+ set step (cat $git_dir/rebase-apply/next ^/dev/null)
+ set total (cat $git_dir/rebase-apply/last ^/dev/null)
if test -f $git_dir/rebase-apply/rebasing
set operation "|REBASE"
else if test -f $git_dir/rebase-apply/applying
@@ -475,6 +482,10 @@ function __fish_git_prompt_operation_branch_bare --description "__fish_git_promp
end
end
+ if test -n "$step" -a -n "$total"
+ set operation "$operation $step/$total"
+ end
+
if test -z "$branch"
set branch (git symbolic-ref HEAD ^/dev/null; set os $status)
if test $os -ne 0