mirror of
https://github.com/IlanCosman/tide.git
synced 2024-12-23 03:52:12 +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
|
function _tide_item_git
|
||||||
if git branch --show-current 2>/dev/null | string replace -r "(.{$tide_git_truncation_length}).+" '$1…' | read -l location
|
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
|
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
|
else if test $pipestatus[1] != 0
|
||||||
return
|
return
|
||||||
else
|
else if git tag --points-at HEAD | string replace -r "(.{$tide_git_truncation_length}).+" '$1…' | read location
|
||||||
# --quiet = don't error if there are no commits
|
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 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$sha
|
||||||
set location '#'$_tide_location_color$location || set location @$_tide_location_color$sha
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Operation
|
# Operation
|
||||||
|
Loading…
Reference in New Issue
Block a user