Merge remote-tracking branch 'ogr3/porcelain-cleanup' into porcelain

* ogr3/porcelain-cleanup:
  Missed one
  Changed all backticks to
master
Dan Nguyen 10 years ago
commit b50cc5cb0d
  1. 12
      gitstatus.sh

@ -15,7 +15,7 @@ if [ -z "${__GIT_PROMPT_DIR}" ]; then
__GIT_PROMPT_DIR="$( cd -P "$( dirname "${SOURCE}" )" && pwd )" __GIT_PROMPT_DIR="$( cd -P "$( dirname "${SOURCE}" )" && pwd )"
fi fi
gitstatus=`LC_ALL=C git status --porcelain --branch` gitstatus=$( LC_ALL=C git status --porcelain --branch )
# if the status is fatal, exit now # if the status is fatal, exit now
[[ "$?" -ne 0 ]] && exit 0 [[ "$?" -ne 0 ]] && exit 0
@ -38,9 +38,9 @@ done <<< "$gitstatus"
if [[ "$__GIT_PROMPT_IGNORE_STASH" = "1" ]]; then if [[ "$__GIT_PROMPT_IGNORE_STASH" = "1" ]]; then
num_stashed=0 num_stashed=0
else 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
num_stashed=`wc -l "${stash_file}" | cut -d' ' -f1` num_stashed=$( wc -l "${stash_file}" | cut -d' ' -f1 )
else else
num_stashed=0 num_stashed=0
fi fi
@ -61,17 +61,17 @@ if [[ "${#line[@]}" -eq 1 ]]; then
fi fi
if [[ -z "$branch" ]]; then if [[ -z "$branch" ]]; then
tag=`git describe --exact-match` tag=$( git describe --exact-match )
if [[ -n "$tag" ]]; then if [[ -n "$tag" ]]; then
branch="$tag" branch="$tag"
else else
branch="_PREHASH_`git rev-parse --short HEAD`" branch="_PREHASH_$( git rev-parse --short HEAD )"
fi fi
elif [[ "$branch" == *"Initial commit on"* ]]; then elif [[ "$branch" == *"Initial commit on"* ]]; then
IFS=" " read -ra branch_line <<< "$branch" IFS=" " read -ra branch_line <<< "$branch"
branch=${branch_line[-1]} branch=${branch_line[-1]}
elif [[ "$branch" == *"no branch"* ]]; then elif [[ "$branch" == *"no branch"* ]]; then
branch="_PREHASH_`git rev-parse --short HEAD`" branch="_PREHASH_$( git rev-parse --short HEAD )"
else else
IFS="[,]" read -ra remote_line <<< "${line[3]}" IFS="[,]" read -ra remote_line <<< "${line[3]}"
for rline in "${remote_line[@]}"; do for rline in "${remote_line[@]}"; do

Loading…
Cancel
Save