5 # TODO this logic should probably rather be in rev-parse itself
7 # whenever an expression foo@@bar is used as an argument
8 # it checks whether foo is a valid reference, and if not, bar is used instead
17 first=`processarg "$first"`
18 rest=`processarg "$rest"`
24 first=`processarg "$first"`
30 first=`processarg "$first"`
36 first=`processarg "$first"`
42 first=`processarg "$first"`
47 first=`processarg "$first"`
51 first=${1%%$SEPARATOR*}
53 if git rev-parse "$first" >/dev/null 2>&1; then
73 set -- "$@" "`processarg "$X"`"
78 # recurse through all sub-repos
80 for GITDIR in `find . -type d -name \*.git`; do
81 # TODO I would LIKE to do this, but then some commands (like pull) fail
82 #export GIT_DIR="$GITDIR"
83 #export GIT_WORK_TREE="${GITDIR%/.git}"
84 # so I will have to chdir instead
86 ( cd "$GITDIR/.." && processargs git "$@" )
87 if [ "$?" -gt "$status" ]; then