From 4e6c65ee9f33261e8881705abdadc0105c9343ed Mon Sep 17 00:00:00 2001 From: Michael Campagnaro Date: Mon, 11 Jun 2018 13:53:44 -0400 Subject: [PATCH] Speedup parse_git_branch() --- windows/bashrc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/windows/bashrc b/windows/bashrc index f54f555..d493dd6 100644 --- a/windows/bashrc +++ b/windows/bashrc @@ -1,3 +1,5 @@ +#set -x # Print out all of the commands that are executing. + # For Windows setup test -f ~/.functions && . ~/.functions test -f ~/.aliases && . ~/.aliases @@ -21,7 +23,9 @@ export TMPDIR=/tmp # Customize the shell prompt parse_git_branch() { - git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' + if [[ "$PWD" != "$HOME" ]]; then + git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' + fi } export PS1='\[\033[0;32m\]\[\033[0m\033[0;32m\]\u\[\033[0;36m\] @ \w\[\033[33m\]\n$(parse_git_branch)\[\033[0;32m\]\[\033[0m\033[0;32m\] \$\[\033[0m\033[0;32m\]\[\033[0m\] '