Skip to content

Commit 6645a82

Browse files
committed
Disable globbing on replacing prompt symbols (fixes magicmonty#295)
1 parent 9af8824 commit 6645a82

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

gitprompt.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,9 @@ function checkUpstream() {
426426
}
427427

428428
function replaceSymbols() {
429+
# Disable globbing, so a * could be used as symbol here
430+
set -f
431+
429432
if [[ -z ${GIT_PROMPT_SYMBOLS_NO_REMOTE_TRACKING} ]]; then
430433
GIT_PROMPT_SYMBOLS_NO_REMOTE_TRACKING=L
431434
fi
@@ -435,6 +438,9 @@ function replaceSymbols() {
435438
local VALUE2=${VALUE1//_NO_REMOTE_TRACKING_/${GIT_PROMPT_SYMBOLS_NO_REMOTE_TRACKING}}
436439

437440
echo ${VALUE2//_PREHASH_/${GIT_PROMPT_SYMBOLS_PREHASH}}
441+
442+
# reenable globbing symbols
443+
set +f
438444
}
439445

440446
function createPrivateIndex {

0 commit comments

Comments
 (0)