mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 05:13:10 +00:00
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:
parent
8642a1e68e
commit
0005702399
1 changed files with 1 additions and 1 deletions
|
@ -507,7 +507,7 @@ function __fish_git_prompt_operation_branch_bare --description "__fish_git_promp
|
||||||
git describe --tags --exact-match HEAD
|
git describe --tags --exact-match HEAD
|
||||||
end ^/dev/null; set os $status)
|
end ^/dev/null; set os $status)
|
||||||
if test $os -ne 0
|
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
|
if test $os -ne 0
|
||||||
set branch unknown
|
set branch unknown
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue