Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if where git &>/dev/null; then
- function prompt-git-branch() {
- local branch_name
- # TODO: show proper name if some heads point the same branch.
- branch_name="$(git name-rev --name-only HEAD 2>/dev/null)"
- if [ $? = 0 ]; then
- echo " [$branch_name]"
- return 0
- else
- return 1
- fi
- }
- else
- function prompt-git-branch() {
- echo ''
- }
- fi
Add Comment
Please, Sign In to add comment