default to configured upstream remote instead of origin

This commit is contained in:
Sami Samhuri 2015-08-25 17:17:10 -07:00
parent c31b5cbc01
commit 1bdd34d97e

View file

@ -2,8 +2,8 @@
set -e # bail on errors set -e # bail on errors
REMOTE="${1:-origin}" ORIG_BRANCH=$(git rev-parse --abbrev-ref HEAD)
ORIG_BRANCH="$(git rev-parse --abbrev-ref HEAD)" REMOTE="${1:-$(git config --get branch.${ORIG_BRANCH}.remote)}"
if [[ "$ORIG_BRANCH" = "HEAD" ]]; then if [[ "$ORIG_BRANCH" = "HEAD" ]]; then
echo "Cannot update in a detached HEAD state" echo "Cannot update in a detached HEAD state"
exit 1 exit 1