From 0005702399ac37bc97682c16ce136b063a27cc56 Mon Sep 17 00:00:00 2001 From: Brian Gernhardt Date: Wed, 3 Jul 2013 01:10:59 -0400 Subject: git_prompt: print unique detached HEAD abbreviated object name Simply using cut duplicates (poorly) `git rev-parse --short` This also restores the ... printed after the abbreviation which __fish_git_prompt had been missing. Based on git.git e8f21ca: "bash prompt: print unique detached HEAD abbreviated object name" --- share/functions/__fish_git_prompt.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'share') diff --git a/share/functions/__fish_git_prompt.fish b/share/functions/__fish_git_prompt.fish index 963b29ec..f9101b97 100644 --- a/share/functions/__fish_git_prompt.fish +++ b/share/functions/__fish_git_prompt.fish @@ -507,7 +507,7 @@ function __fish_git_prompt_operation_branch_bare --description "__fish_git_promp git describe --tags --exact-match HEAD end ^/dev/null; set os $status) if test $os -ne 0 - set branch (cut -c1-7 $git_dir/HEAD ^/dev/null; set os $status) + set branch (git rev-parse --short HEAD ^/dev/null; set os $status)... if test $os -ne 0 set branch unknown end -- cgit v1.2.3