# In this mode you can request colored hints using GIT_PS1_SHOWCOLORHINTS=true
__git_ps1 ()
{
+ # preserve exit status
local exit=$?
local pcmode=no
local detached=no
;;
0|1) printf_format="${1:-$printf_format}"
;;
- *) return
+ *) return $exit
;;
esac
rev_parse_exit_code="$?"
if [ -z "$repo_info" ]; then
- return
+ return $exit
fi
local short_sha
[ "$(git config --bool bash.hideIfPwdIgnored)" != "false" ] &&
git check-ignore -q .
then
- return
+ return $exit
fi
local r=""
else
local head=""
if ! __git_eread "$g/HEAD" head; then
- return
+ return $exit
fi
# is it a symbolic ref?
b="${head#ref: }"
printf -- "$printf_format" "$gitstring"
fi
- # preserve exit status
return $exit
}