From c33d7e951a60e82e1745ed85b89b7097cf4bbff8 Mon Sep 17 00:00:00 2001 From: Paul Irish Date: Sat, 24 Jan 2015 13:24:40 -0800 Subject: [PATCH] =?UTF-8?q?Much=20faster=20git=20checks,=20via=20dotfiles?= =?UTF-8?q?=20git=20prompt=20https://github.com/paulirish/dotfiles/blob/19?= =?UTF-8?q?b37f9ca7d17aeb=CE=BB1a2c74bcbac77023706b26/.bash=5Fprompt#L81-L?= =?UTF-8?q?97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gh.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gh.sh b/gh.sh index 8ebf4e7..e1bf791 100755 --- a/gh.sh +++ b/gh.sh @@ -4,7 +4,7 @@ # # gh [remote] [branch] -git rev-parse 2>/dev/null +git rev-parse --is-inside-work-tree 2>/dev/null if [[ $? != 0 ]] then @@ -32,7 +32,7 @@ giturl=${giturl%\.git} if [ -z "$2" ] then - branch=$(git rev-parse --abbrev-ref HEAD 2>/dev/null) + branch=`git symbolic-ref -q HEAD | sed -e 's|^refs/heads/||'` else branch="$2" fi