Remove use of wc

master
Dan Nguyen 10 years ago
parent 5293850880
commit 1786764bc1
  1. 12
      gitstatus.sh

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

Loading…
Cancel
Save