Skip to content

Commit

Permalink
fixes a trailing space when local dir not clean (#453)
Browse files Browse the repository at this point in the history
Explanation:

For some reason there's a trailing space, when there are changes available on the remote:

master {upstream/master } ↓·9|✔]$

After doing a `git pull`, the prompt is fine again:

master {upstream/master}|✔]$

This change trims the upstream var in gitstatus.sh
  • Loading branch information
tessus authored and magicmonty committed Nov 17, 2019
1 parent 5a8b5d7 commit 148d502
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion gitstatus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,13 @@ if [[ -z "${upstream:+x}" ]] ; then
upstream='^'
fi

UPSTREAM_TRIMMED=`echo $upstream |xargs`

printf "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n" \
"${branch}${state}" \
"${remote}" \
"${remote_url}" \
"${upstream}" \
"${UPSTREAM_TRIMMED}" \
"${num_staged}" \
"${num_conflicts}" \
"${num_changed}" \
Expand Down

0 comments on commit 148d502

Please sign in to comment.