mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-12 21:18:53 +00:00
Indent __fish_git_prompt
This commit is contained in:
parent
0882e0cb95
commit
f23464001f
1 changed files with 471 additions and 466 deletions
|
@ -190,7 +190,8 @@ function __fish_git_prompt_show_upstream --description "Helper function for __fi
|
|||
switch $key
|
||||
case bash.showupstream
|
||||
set show_upstream $value
|
||||
test -n "$show_upstream"; or return
|
||||
test -n "$show_upstream"
|
||||
or return
|
||||
case svn-remote.'*'.url
|
||||
set svn_remote $svn_remote $value
|
||||
# Avoid adding \| to the beginning to avoid needing #?? later
|
||||
|
@ -333,13 +334,15 @@ function __fish_git_prompt --description "Prompt function for Git"
|
|||
return 1
|
||||
end
|
||||
set -l repo_info (command git rev-parse --git-dir --is-inside-git-dir --is-bare-repository --is-inside-work-tree HEAD ^/dev/null)
|
||||
test -n "$repo_info"; or return
|
||||
test -n "$repo_info"
|
||||
or return
|
||||
|
||||
set -l git_dir $repo_info[1]
|
||||
set -l inside_gitdir $repo_info[2]
|
||||
set -l bare_repo $repo_info[3]
|
||||
set -l inside_worktree $repo_info[4]
|
||||
set -q repo_info[5]; and set -l sha $repo_info[5]
|
||||
set -q repo_info[5]
|
||||
and set -l sha $repo_info[5]
|
||||
|
||||
set -l rbc (__fish_git_prompt_operation_branch_bare $repo_info)
|
||||
set -l r $rbc[1] # current operation
|
||||
|
@ -445,7 +448,8 @@ function __fish_git_prompt_staged --description "__fish_git_prompt helper, tells
|
|||
set -l staged
|
||||
|
||||
if test -n "$sha"
|
||||
command git diff-index --cached --quiet HEAD --; or set staged $___fish_git_prompt_char_stagedstate
|
||||
command git diff-index --cached --quiet HEAD --
|
||||
or set staged $___fish_git_prompt_char_stagedstate
|
||||
else
|
||||
set staged $___fish_git_prompt_char_invalidstate
|
||||
end
|
||||
|
@ -512,7 +516,8 @@ function __fish_git_prompt_operation_branch_bare --description "__fish_git_promp
|
|||
set -l git_dir $argv[1]
|
||||
set -l inside_gitdir $argv[2]
|
||||
set -l bare_repo $argv[3]
|
||||
set -q argv[5]; and set -l sha $argv[5]
|
||||
set -q argv[5]
|
||||
and set -l sha $argv[5]
|
||||
|
||||
set -l branch
|
||||
set -l operation
|
||||
|
|
Loading…
Reference in a new issue