X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=pull-usrlocalsrc;h=c7159ada349311b42b2170e494c4c84c7621f9dd;hb=HEAD;hp=085520632d821711b13f35786d6057eae48e67c9;hpb=2c654e316392a8b3523ea0495902372d54548e1c;p=git-scripts.git diff --git a/pull-usrlocalsrc b/pull-usrlocalsrc index 0855206..c7159ad 100755 --- a/pull-usrlocalsrc +++ b/pull-usrlocalsrc @@ -1,7 +1,5 @@ #! /bin/sh -PATH=/usr/local/src/Python/git-remote-hg:$PATH - has_remote() { git remote show "$1" >/dev/null 2>&1 } @@ -11,9 +9,10 @@ prog_dir="`dirname \"$0\"`" && cat "$prog_dir"/locate-all.list | grep -F /usr/local/src | while read d; do echo "----- $d -----"; cd "$d" && - if has_remote source && has_remote origin; then - git pull source master && git push origin master || exit 1 - else - git remote | xargs -I'{}' git pull '{}' master || exit 1 + if has_remote upstream && has_remote origin; then + { git pull upstream master || git pull upstream main:master; } && + git push origin master || exit 1 + elif has_remote origin; then + git pull origin master || git pull origin main:master || exit 1 fi done