1
0
mirror of https://github.com/dcarrillo/prezto.git synced 2025-07-02 00:29:25 +00:00

git: Optimize scripts for git helper functions

Optimize git internal calls and adjustment git helper functions to use
more idiomatic Zsh conventions avoiding external calls.
This commit is contained in:
Indrajit Raychaudhuri
2021-05-19 19:54:57 -05:00
committed by Indrajit Raychaudhuri
parent efebe3efec
commit a3643f124e
6 changed files with 14 additions and 14 deletions

View File

@ -229,8 +229,8 @@ function git-info {
[[ "$commondir" =~ ^/ ]] || commondir="$(git-dir)/$commondir"
fi
if [[ -f "$(git-dir)/refs/stash" || ( -n "$commondir" && -f "$commondir/refs/stash" ) ]]; then
stashed="$(command git stash list 2> /dev/null | wc -l | awk '{print $1}')"
if [[ -n "$stashed" ]]; then
stashed=${#${(f)"$(command git stash list 2> /dev/null)"}}
if (( $stashed > 0 )); then
zformat -f stashed_formatted "$stashed_format" "S:$stashed"
fi
fi