-find . -type d -name \*.git | while IFS= read -r GITDIR; do
- processargs git --git-dir="$GITDIR" --work-tree="${GITDIR%/.git}" "$@"
+status=0
+for GITDIR in `find . -type d -name \*.git`; do
+ # TODO I would LIKE to do this, but then some commands (like pull) fail
+ #export GIT_DIR="$GITDIR"
+ #export GIT_WORK_TREE="${GITDIR%/.git}"
+ # so I will have to chdir instead
+
+ ( cd "$GITDIR/.." && processargs git "$@" )
+ if [ "$?" -gt "$status" ]; then
+ status=$?
+ fi