about summary refs log tree commit diff
path: root/Functions/VCS_Info/Backends
diff options
context:
space:
mode:
Diffstat (limited to 'Functions/VCS_Info/Backends')
-rw-r--r--Functions/VCS_Info/Backends/VCS_INFO_get_data_hg5
1 files changed, 3 insertions, 2 deletions
diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg b/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg
index 2324bc809..8e91d2651 100644
--- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg
+++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg
@@ -58,10 +58,11 @@ fi
 # If the user doesn't opt to invoke hg we can still get the current branch
 if [[ -z ${r_branch} && -r ${branchfile} ]] ; then
     r_branch=$(< ${branchfile})
-else
-    r_branch="default"
 fi
 
+# If we still don't know the branch it's safe to assume default
+[[ -n ${r_branch} ]] || r_branch="default"
+
 # The working dir has uncommitted-changes if the revision ends with a +
 if [[ $r_lrev[-1] == + ]] ; then
     hgchanges=1