From f66f7e484fa1732f97402f3b6be958d8d8adb27a Mon Sep 17 00:00:00 2001 From: equt Date: Wed, 11 Nov 2020 22:38:19 +0800 Subject: [PATCH] [ fix #891 ] Cast branch output if HEAD not exists --- bin/git-browse | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/git-browse b/bin/git-browse index a6faa15..4acab81 100755 --- a/bin/git-browse +++ b/bin/git-browse @@ -2,7 +2,7 @@ if [[ $1 == "" ]] then - branch=$(git rev-parse --abbrev-ref HEAD) + branch=$(git rev-parse --abbrev-ref HEAD 2&> /dev/null) remote=$(git config branch."${branch}".remote || echo "origin") else remote=$1