From: Rudolf Polzer Date: Sat, 15 May 2010 20:59:07 +0000 (+0200) Subject: ./all: checkout with no arg checks out the default branch X-Git-Tag: xonotic-v0.1.0preview~456 X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fxonotic.git;a=commitdiff_plain;h=94fd858c89410402003a550d997306009482fd72 ./all: checkout with no arg checks out the default branch --- diff --git a/all b/all index 93578fc8..bdb93f26 100755 --- a/all +++ b/all @@ -252,12 +252,17 @@ case "$cmd" in exists=false for d in $repos; do enter "$d0/$d" verbose - if git rev-parse "refs/heads/$branch" >/dev/null 2>&1; then + if [ -z "$branch" ]; then + b=`repobranch "$d"` + else + b=$branch + fi + if git rev-parse "refs/heads/$b" >/dev/null 2>&1; then exists=true - verbose git checkout "$branch" - elif git rev-parse "refs/remotes/$remote/$branch" >/dev/null 2>&1; then + verbose git checkout "$b" + elif git rev-parse "refs/remotes/$remote/$b" >/dev/null 2>&1; then exists=true - verbose git checkout --track -b "$branch" "$remote/$branch" + verbose git checkout --track -b "$b" "$remote/$b" else verbose git checkout "`repobranch "$d"`" fi