From 70208eb33a783579e528b8491166dc9d593153d1 Mon Sep 17 00:00:00 2001 From: Brian Gernhardt Date: Wed, 12 Jun 2013 16:29:02 -0400 Subject: [PATCH] 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. --- share/functions/__fish_git_prompt.fish | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/share/functions/__fish_git_prompt.fish b/share/functions/__fish_git_prompt.fish index b72352ed4..5c528beae 100644 --- a/share/functions/__fish_git_prompt.fish +++ b/share/functions/__fish_git_prompt.fish @@ -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