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"
This commit is contained in:
Brian Gernhardt 2013-07-03 01:10:59 -04:00
parent 8642a1e68e
commit 0005702399

View file

@ -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