X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=pull-usrlocalsrc;h=ef9167b7f70561a8ac522b1400adda822c7cae33;hb=d5edda00cd5b8ecd8ca9b3b38654b25176beb3cb;hp=92156d9e1f22510ad3254ae0a2485450c92624b9;hpb=ce9945396a4294227258f07f528fcf53984c7175;p=git-scripts.git diff --git a/pull-usrlocalsrc b/pull-usrlocalsrc index 92156d9..ef9167b 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 } @@ -12,8 +10,9 @@ cat "$prog_dir"/locate-all.list | grep -F /usr/local/src | while read d; do echo "----- $d -----"; cd "$d" && if has_remote upstream && has_remote origin; then - git pull upstream master && git push origin master || exit 1 - else - git remote | xargs -I'{}' git pull '{}' master || exit 1 + { git pull upstream master || git pull upstream main:master; } && + git push origin master || exit 1 + elif has_remote origin; then + git pull origin master || exit 1 fi done