]> git.phdru.name Git - git-scripts.git/blobdiff - update-remotes
Simplify regular expressions for `compileall`
[git-scripts.git] / update-remotes
index 2eb9427fa531243a8a680c2b9fa5dc55a75ec870..75f7f53568d3a757144844690a350e68f330ff15 100755 (executable)
@@ -2,6 +2,7 @@
 
 current="`git config --get --path remote.current.url`"
 origin="`git config --get --path remote.origin.url`"
+branches="master ${1:+$@}"
 
 if [ -n "$origin" ]; then
    if [ -n "$current" ]; then
@@ -16,11 +17,12 @@ elif [ -z "$current" ]; then
    exit 1
 fi
 
-{ git pull --ff-only current master || git reset --hard current/master } &&
+git fetch current &&
+{ git pull --ff-only current master || git reset --hard current/master ; } &&
 
 web="`git config --get --path remote.web.url`" &&
 if [ -n "$web" ]; then
-   git push web
+   git push --force web $branches
 fi &&
 
 cd "$current" && exec git pull origin