From 669d068b120b520b141c29cb46bdd1b557f955d5 Mon Sep 17 00:00:00 2001 From: Robert Rauch Date: Thu, 2 Jun 2016 10:36:37 +0200 Subject: [PATCH] Support HG_ROOT containing whitespaces --- themes/base.theme.bash | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/themes/base.theme.bash b/themes/base.theme.bash index 2f1bf4b3..d961b10d 100644 --- a/themes/base.theme.bash +++ b/themes/base.theme.bash @@ -256,16 +256,16 @@ function hg_prompt_vars { HG_ROOT=$(get_hg_root) - if [ -f $HG_ROOT/branch ]; then + if [ -f "$HG_ROOT/branch" ]; then # Mercurial holds it's current branch in .hg/branch file - SCM_BRANCH=$(cat $HG_ROOT/branch) + SCM_BRANCH=$(cat "$HG_ROOT/branch") else SCM_BRANCH=$(hg summary 2> /dev/null | grep branch: | awk '{print $2}') fi - if [ -f $HG_ROOT/dirstate ]; then + if [ -f "$HG_ROOT/dirstate" ]; then # Mercurial holds various information about the working directory in .hg/dirstate file. More on http://mercurial.selenic.com/wiki/DirState - SCM_CHANGE=$(hexdump -n 10 -e '1/1 "%02x"' $HG_ROOT/dirstate | cut -c-12) + SCM_CHANGE=$(hexdump -n 10 -e '1/1 "%02x"' "$HG_ROOT/dirstate" | cut -c-12) else SCM_CHANGE=$(hg summary 2> /dev/null | grep parent: | awk '{print $2}') fi