]> git.phdru.name Git - git-scripts.git/blobdiff - pull-usrlocalsrc
Do not pack submodules in bare repos
[git-scripts.git] / pull-usrlocalsrc
index f8654c0839ce407c10f2f084a4741c29906a1157..085520632d821711b13f35786d6057eae48e67c9 100755 (executable)
@@ -1,9 +1,19 @@
 #! /bin/sh
 
+PATH=/usr/local/src/Python/git-remote-hg:$PATH
+
+has_remote() {
+   git remote show "$1" >/dev/null 2>&1
+}
+
 prog_dir="`dirname \"$0\"`" &&
 
 cat "$prog_dir"/locate-all.list | grep -F /usr/local/src |
-while true; do
-   read d || exit 0
-   echo "----- $d -----"; cd "$d" && git pull --all || exit 1
+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
+   fi
 done