Merge pull request #892 from equt/#891

[ fix #891 ] Cast branch output if HEAD not exists
This commit is contained in:
罗泽轩 2020-11-14 10:19:04 +08:00 committed by GitHub
commit 68e6a15401
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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