This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
has() { type "$1" >/dev/null 2>&1; } | |
__ps1_git() { | |
local B S C c u z | |
# If not in working tree return | |
git rev-parse --is-inside-work-tree &>/dev/null || return | |
B=$(git branch --show-current 2>/dev/null) | |
# If there is no branch your are detached | |
[[ -z $B ]] && B=$(git rev-parse --short HEAD) | |
S=$(git status --porcelain -s 2>/dev/null) |