Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
ogr3 committed Nov 13, 2018
2 parents afbc1f9 + af1df49 commit 257ec85
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion gitstatus_pre-1.7.10.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,19 @@ if [ -z "${__GIT_PROMPT_DIR}" ]; then
__GIT_PROMPT_DIR="$( cd -P "$( dirname "${SOURCE}" )" && pwd )"
fi

if [[ "${__GIT_PROMPT_WITH_USERNAME_AND_REPO}" == "1" ]]; then
# returns "user/repo" from remote.origin.url git variable
#
# supports urls:
# https://[email protected]/user/repo.git
# https://github.com/user/repo.git
# [email protected]:user/repo.git
#
remote_url=$(git config --get remote.origin.url | sed 's|^.*//||; s/.*@//; s/[^:/]\+[:/]//; s/.git$//')
else
remote_url='.'
fi

gitsym=$( git symbolic-ref HEAD 2>/dev/null )

#If exit status OK, we have a branch
Expand Down Expand Up @@ -99,6 +112,7 @@ else
fi
else
remote='_NO_REMOTE_TRACKING_'
remote_url='.'
unset upstream
fi
fi
Expand All @@ -111,9 +125,10 @@ if [[ -z "$upstream" ]] ; then
upstream='^'
fi

printf "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n" \
printf "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n" \
"$branch" \
"$remote" \
"$remote_url" \
"$upstream" \
$num_staged \
$num_conflicts \
Expand Down

0 comments on commit 257ec85

Please sign in to comment.