Use dynamic branch instead of master to get remote in git-update

This commit is contained in:
Sami Samhuri 2019-10-22 11:33:39 -05:00
parent 5f8431e7e2
commit b5442b55c7

View file

@ -7,7 +7,7 @@ function current_branch() {
}
ORIG_BRANCH=$(current_branch)
DEFAULT_REMOTE=$(git config --get branch.master.remote)
DEFAULT_REMOTE=$(git config --get branch.${ORIG_BRANCH}.remote)
REMOTE="${1:-$DEFAULT_REMOTE}"
if [[ "$ORIG_BRANCH" = "HEAD" ]]; then
echo "Cannot update in a detached HEAD state"