From 9e4f1d6d800b8be92e5c33ebf022972d3c29890f Mon Sep 17 00:00:00 2001 From: Ivan Font Date: Mon, 9 Jan 2017 21:17:00 -0800 Subject: [PATCH] Refactor common code into scm_prompt_info_common --- themes/base.theme.bash | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/themes/base.theme.bash b/themes/base.theme.bash index 1b64265c..7ee3330c 100644 --- a/themes/base.theme.bash +++ b/themes/base.theme.bash @@ -92,30 +92,16 @@ function scm_prompt_vars { function scm_prompt_info { scm scm_prompt_char - SCM_DIRTY=0 - SCM_STATE='' - - if [[ ${SCM} == ${SCM_GIT} ]]; then - if [[ ${SCM_GIT_SHOW_MINIMAL_INFO} == true ]]; then - # user requests minimal git status information - git_prompt_minimal_info - else - # more detailed git status - git_prompt_info - fi - return - fi - - # TODO: consider adding minimal status information for hg and svn - [[ ${SCM} == ${SCM_HG} ]] && hg_prompt_info && return - [[ ${SCM} == ${SCM_SVN} ]] && svn_prompt_info && return + scm_prompt_info_common } function scm_prompt_char_info { - # Determine the scm char and print it scm_prompt_char echo -ne "${SCM_CHAR}" + scm_prompt_info_common +} +function scm_prompt_info_common { SCM_DIRTY=0 SCM_STATE=''