From 94fd858c89410402003a550d997306009482fd72 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Sat, 15 May 2010 22:59:07 +0200 Subject: [PATCH] ./all: checkout with no arg checks out the default branch --- all | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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 -- 2.39.2