From ed2240e21464222be7a0afc4c9635e8187c667d9 Mon Sep 17 00:00:00 2001 From: Matthew Rothenberg Date: Wed, 15 Oct 2014 02:21:35 -0400 Subject: [PATCH] BUGFIX: actually clear variables The current `git_clear_vars()` method appears to have iterated over all the existing set variable correctly, but never actually bothered to clear them. --- lib/git/status_shortcuts.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/git/status_shortcuts.sh b/lib/git/status_shortcuts.sh index e5686c2..41671d4 100644 --- a/lib/git/status_shortcuts.sh +++ b/lib/git/status_shortcuts.sh @@ -166,7 +166,12 @@ git_clear_vars() { local i for (( i=1; i<=$gs_max_changes; i++ )); do # Stop clearing after first empty var - if [[ -z "$(eval echo "\${$git_env_char$i:-}")" ]]; then break; fi + local env_var_i=${git_env_char}${i} + if [[ -z "$(eval echo "\${$env_var_i:-}")" ]]; then + break + else + unset $env_var_i + fi done }