mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-01 17:26:13 +08:00
git_prompt: Add branch information for rebase
This commit is contained in:
parent
5753fa2106
commit
d5c1bf98d7
|
@ -390,8 +390,10 @@ function __fish_git_prompt_operation_branch_bare --description "__fish_git_promp
|
||||||
|
|
||||||
if test -f $git_dir/rebase-merge/interactive
|
if test -f $git_dir/rebase-merge/interactive
|
||||||
set operation "|REBASE-i"
|
set operation "|REBASE-i"
|
||||||
|
set branch (cat $git_dir/rebase-merge/head-name ^/dev/null)
|
||||||
else if test -d $git_dir/rebase-merge
|
else if test -d $git_dir/rebase-merge
|
||||||
set operation "|REBASE-m"
|
set operation "|REBASE-m"
|
||||||
|
set branch (cat $git_dir/rebase-merge/head-name ^/dev/null)
|
||||||
else
|
else
|
||||||
if test -d $git_dir/rebase-apply
|
if test -d $git_dir/rebase-apply
|
||||||
if test -f $git_dir/rebase-apply/rebasing
|
if test -f $git_dir/rebase-apply/rebasing
|
||||||
|
@ -410,8 +412,10 @@ function __fish_git_prompt_operation_branch_bare --description "__fish_git_promp
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if test -z "$branch"
|
||||||
set branch (git symbolic-ref HEAD ^/dev/null; set os $status)
|
set branch (git symbolic-ref HEAD ^/dev/null; set os $status)
|
||||||
if test $os -ne 0
|
if test $os -ne 0
|
||||||
|
set detached yes
|
||||||
set branch (switch "$__fish_git_prompt_describe_style"
|
set branch (switch "$__fish_git_prompt_describe_style"
|
||||||
case contains
|
case contains
|
||||||
git describe --contains HEAD
|
git describe --contains HEAD
|
||||||
|
@ -430,6 +434,7 @@ function __fish_git_prompt_operation_branch_bare --description "__fish_git_promp
|
||||||
end
|
end
|
||||||
set branch "($branch)"
|
set branch "($branch)"
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if test "true" = (git rev-parse --is-inside-git-dir ^/dev/null)
|
if test "true" = (git rev-parse --is-inside-git-dir ^/dev/null)
|
||||||
if test "true" = (git rev-parse --is-bare-repository ^/dev/null)
|
if test "true" = (git rev-parse --is-bare-repository ^/dev/null)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user