fix: whonix uwt wrapper messes with git existence

This commit is contained in:
Ben Grande 2024-01-31 16:12:00 +01:00
parent 5634910c97
commit 0ef9267754
No known key found for this signature in database
GPG Key ID: 00C64E14F51F9E56

View File

@ -205,6 +205,10 @@ _get_prompt_time(){
_git_prompt_info(){
has git || return
## Whonix UWT wrapper circumvents the command existence check.
if test -f /usr/share/whonix/marker; then
git -v >/dev/null 2>&1 || return
fi
ref="$(git symbolic-ref HEAD 2>/dev/null | cut -d '/' -f3)"
test "${ref-}" || ref="$(git describe --tags --exact-match HEAD 2>/dev/null)"
test "${ref-}" || ref="$(git rev-parse HEAD 2>/dev/null | head -c 7)"