mirror of
https://github.com/IlanCosman/tide.git
synced 2024-12-22 19:41:36 +03:00
Minor performance improvement for git item
This commit is contained in:
parent
133f043923
commit
267187e0de
@ -1,14 +1,15 @@
|
||||
function _tide_item_git
|
||||
if git branch --show-current 2>/dev/null | string replace -r "(.{$tide_git_truncation_length}).+" '$1…' | read -l location
|
||||
set location $_tide_location_color$location
|
||||
git rev-parse --git-dir --is-inside-git-dir | read -f --line git_dir inside_git_dir
|
||||
set location $_tide_location_color$location
|
||||
else if test $pipestatus[1] != 0
|
||||
return
|
||||
else
|
||||
# --quiet = don't error if there are no commits
|
||||
else if git tag --points-at HEAD | string replace -r "(.{$tide_git_truncation_length}).+" '$1…' | read location
|
||||
git rev-parse --git-dir --is-inside-git-dir | read -f --line git_dir inside_git_dir
|
||||
set location '#'$_tide_location_color$location
|
||||
else # --quiet = don't error if there are no commits
|
||||
git rev-parse --git-dir --is-inside-git-dir --quiet --short HEAD | read -f --line git_dir inside_git_dir sha
|
||||
git tag --points-at HEAD | string replace -r "(.{$tide_git_truncation_length}).+" '$1…' | read location &&
|
||||
set location '#'$_tide_location_color$location || set location @$_tide_location_color$sha
|
||||
set location @$_tide_location_color$sha
|
||||
end
|
||||
|
||||
# Operation
|
||||
|
Loading…
Reference in New Issue
Block a user