diff --git a/scripts/scm-prompt.sh b/scripts/scm-prompt.sh --- a/scripts/scm-prompt.sh +++ b/scripts/scm-prompt.sh @@ -193,7 +193,7 @@ # - provide a space for the user so that they don't have to have # random extra spaces in their prompt when not in a repo # - provide parens so it's differentiated from other crap in their prompt - fmt="${1:-' (%s)'}" + fmt="${1:- (%s)}" # find out if we're in a git or hg repo by looking for the control dir dir="$PWD" diff --git a/tests/test-scm-prompt-compat.t b/tests/test-scm-prompt-compat.t --- a/tests/test-scm-prompt-compat.t +++ b/tests/test-scm-prompt-compat.t @@ -35,3 +35,7 @@ $ hg init repo $ oldcmd cd repo g g empty g g + +Test main prompt with no format string + $ _scm_prompt + (empty) (no-eol)