mirror of
https://github.com/tj/git-extras.git
synced 2026-09-12 08:26:17 -04:00
[ fix #891 ] Cast branch output if HEAD not exists
This commit is contained in:
parent
ad8c77bfa3
commit
f66f7e484f
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue