Fix branch detection.
This commit is contained in:
parent
06128ca26d
commit
66537fbcde
1 changed files with 3 additions and 3 deletions
6
.bashrc
6
.bashrc
|
@ -52,9 +52,9 @@ __prompt_git_status() {
|
|||
fi
|
||||
}
|
||||
|
||||
# Add the branch if there have been commits.
|
||||
if [[ -e "${GIT_REPO_INFO[1]}/refs/heads/master" ]]; then
|
||||
BRANCH="$(git describe --contains --all HEAD)"
|
||||
# Add the branch or a no commits marker.
|
||||
BRANCH="$(git describe --contains --all HEAD 2>/dev/null)"
|
||||
if [[ -n "$BRANCH" ]]; then
|
||||
GIT_PROMPT+="$BRANCH"
|
||||
else
|
||||
GIT_PROMPT+="!NO COMMITS!"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue