Merge pull request #176 from pedantic79/porcelain

Remove calling wc to count lines.
master
Martin Gondermann 10 years ago
commit 1b31e33d93
  1. 10
      gitstatus.sh

@ -35,15 +35,13 @@ while IFS='' read -r line || [[ -n "$line" ]]; do
esac
done <<< "$gitstatus"
if [[ "$__GIT_PROMPT_IGNORE_STASH" = "1" ]]; then
num_stashed=0
else
if [[ "$__GIT_PROMPT_IGNORE_STASH" != "1" ]]; then
stash_file="$( git rev-parse --git-dir )/logs/refs/stash"
if [[ -e "${stash_file}" ]]; then
wc_output=$( wc -l < "${stash_file}" )
num_stashed=${wc_output//[[:space:]]/}
else
num_stashed=0
while IFS='' read -r wcline || [[ -n "$wcline" ]]; do
((num_stashed++))
done < ${stash_file}
fi
fi

Loading…
Cancel
Save