mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-23 20:54:04 +08:00
git prompt: Fix hang on detached head.
$git_dir was never set in __fish_git_prompt_current_branch, but used in the case of a detached HEAD. This caused `cut -c1-7 $git_dir/HEAD` to expand to `cut -c1-7` which then waited for input.
This commit is contained in:
parent
825a7311ea
commit
70208eb33a
|
@ -209,7 +209,7 @@ function __fish_git_prompt --description "Prompt function for Git"
|
|||
test -n "$git_dir"; or return
|
||||
|
||||
set -l r (__fish_git_prompt_current_operation $git_dir)
|
||||
set -l b (__fish_git_prompt_current_branch)
|
||||
set -l b (__fish_git_prompt_current_branch $git_dir)
|
||||
set -l w #dirty working directory
|
||||
set -l i #staged changes
|
||||
set -l s #stashes
|
||||
|
@ -322,6 +322,7 @@ function __fish_git_prompt_current_branch_bare --description "__fish_git_prompt
|
|||
end
|
||||
|
||||
function __fish_git_prompt_current_branch --description "__fish_git_prompt helper, returns the current Git branch"
|
||||
set -l git_dir $argv[1]
|
||||
set -l branch
|
||||
|
||||
set -l os
|
||||
|
|
Loading…
Reference in New Issue
Block a user