#! /bin/sh
+set -e
-current="`git config --get --path remote.current.url`"
-origin="`git config --get --path remote.origin.url`"
+current="`git config --get --path remote.current.url`" || :
+origin="`git config --get --path remote.origin.url`" || :
branches="master ${1:+$@}"
if [ -n "$origin" ]; then
echo "Config error (both origin and current)" >&2
exit 1
else
- cd "$origin" &&
+ cd "$origin"
exec ./update-remotes "$@"
fi
elif [ -z "$current" ]; then
exit 1
fi
-git fetch current &&
-{ git pull --ff-only current master || git reset --hard current/master ; } &&
-git set-date &&
+git fetch current
+{ git pull --ff-only current master || git reset --hard current/master ; }
+git set-date
-web="`git config --get --path remote.web.url`" &&
+web="`git config --get --path remote.web.url`"
if [ -n "$web" ]; then
git push --force web $branches
-fi &&
+fi
-cd "$current" &&
-git pull origin &&
+cd "$current"
+git pull origin
exec git set-date