Skip to content

Commit

Permalink
fix[osc-prompt]: correctly check for being inside of git checkout
Browse files Browse the repository at this point in the history
Unfortunately, it breaks only in git-prompt.sh, so it was a bitch
to debug.
  • Loading branch information
mcepl committed Oct 25, 2024
1 parent 9590683 commit f7d7573
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion contrib/osc-prompt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

__osc_prompt() {
# Git has a precedence
if [ -d .git ] ; then
if git rev-parse --quiet --git-dir >/dev/null 2>&1 ; then
# Test for the existence of bash function
declare -F __git_ps1 >/dev/null && printf "%s" "$(__git_ps1 "$@")"
return
fi

# Are we even in the OSC checkout?
[ -d .osc ] || return

Expand Down

0 comments on commit f7d7573

Please sign in to comment.