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