Skip env variables for git branch if there are more than 300 branches

This commit is contained in:
Nathan Broadbent
2016-05-14 22:22:20 +07:00
parent 67de7a682b
commit 987da4d6a2

View File

@@ -13,8 +13,9 @@
unalias $git_branch_alias > /dev/null 2>&1; unset -f $git_branch_alias > /dev/null 2>&1 unalias $git_branch_alias > /dev/null 2>&1; unset -f $git_branch_alias > /dev/null 2>&1
function _scmb_git_branch_shortcuts { function _scmb_git_branch_shortcuts {
fail_if_not_git_repo || return 1 fail_if_not_git_repo || return 1
# Fall back to normal git branch, if any unknown args given # Fall back to normal git branch, if any unknown args given
if [[ -n "$@" ]] && [[ "$@" != "-a" ]]; then if [[ "$($_git_cmd branch | wc -l)" -gt 300 ]] || ([[ -n "$@" ]] && [[ "$@" != "-a" ]]); then
exec_scmb_expand_args $_git_cmd branch "$@" exec_scmb_expand_args $_git_cmd branch "$@"
return 1 return 1
fi fi