From 6645a82003d552f7411f574499b26cc1961838f2 Mon Sep 17 00:00:00 2001 From: Martin Gondermann Date: Sat, 5 Nov 2016 21:44:35 +0100 Subject: [PATCH] Disable globbing on replacing prompt symbols (fixes #295) --- gitprompt.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gitprompt.sh b/gitprompt.sh index 23f7bc3..9ff5b42 100755 --- a/gitprompt.sh +++ b/gitprompt.sh @@ -426,6 +426,9 @@ function checkUpstream() { } function replaceSymbols() { + # Disable globbing, so a * could be used as symbol here + set -f + if [[ -z ${GIT_PROMPT_SYMBOLS_NO_REMOTE_TRACKING} ]]; then GIT_PROMPT_SYMBOLS_NO_REMOTE_TRACKING=L fi @@ -435,6 +438,9 @@ function replaceSymbols() { local VALUE2=${VALUE1//_NO_REMOTE_TRACKING_/${GIT_PROMPT_SYMBOLS_NO_REMOTE_TRACKING}} echo ${VALUE2//_PREHASH_/${GIT_PROMPT_SYMBOLS_PREHASH}} + + # reenable globbing symbols + set +f } function createPrivateIndex {