change to setting variables to empty value before use

This commit is contained in:
Ethan Edwards
2018-04-30 13:40:08 -05:00
parent 10d075c9c5
commit 1a7ebf4da7
2 changed files with 9 additions and 3 deletions

View File

@@ -71,7 +71,8 @@ function _git-hide-status {
}
function _git-status {
[[ "${SCM_GIT_IGNORE_UNTRACKED}" = "true" ]] && local git_status_flags='-uno'
local git_status_flags=
[[ "${SCM_GIT_IGNORE_UNTRACKED}" = "true" ]] && git_status_flags='-uno'
git status --porcelain ${git_status_flags:-} 2> /dev/null
}
@@ -102,7 +103,8 @@ function _git-status-counts {
function _git-remote-info {
[[ "$(_git-upstream)" == "" ]] && return
[[ "$(_git-branch)" == "$(_git-upstream-branch)" ]] && local same_branch_name=true
local same_branch_name=
[[ "$(_git-branch)" == "$(_git-upstream-branch)" ]] && same_branch_name=true
if ([[ "${SCM_GIT_SHOW_REMOTE_INFO}" = "auto" ]] && [[ "$(_git-num-remotes)" -ge 2 ]]) ||
[[ "${SCM_GIT_SHOW_REMOTE_INFO}" = "true" ]]; then
if [[ "${same_branch_name}" != "true" ]]; then