diff mbox

[COMMITTED] Correction for git commit 47e9ce2141cbe48d852b1bb2e9679c3d4fbaf9d2

Message ID 1381529663-1017-1-git-send-email-ryan.arnold@linaro.org
State New
Headers show

Commit Message

Ryan S. Arnold Oct. 11, 2013, 10:14 p.m. UTC
From: "Ryan S. Arnold" <ryan.arnold@linaro.org>

For some reason the merge for patch "[PATCH] Fix git clone to get repo without branch name as part of the url" merged the change into the wrong spot.  This patch fixes it and puts it on the correct 'if' leg.

I tested with a build.

Ryan S. Arnold

---
 lib/checkout.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff mbox

Patch

diff --git a/lib/checkout.sh b/lib/checkout.sh
index 30c7941..9842e69 100644
--- a/lib/checkout.sh
+++ b/lib/checkout.sh
@@ -79,12 +79,12 @@  checkout()
 		dryrun "(cd ${srcdir} && git pull origin ${branch})"
 	    else
 		if test x"${branch}" = x; then
-		    # Strip off the "/<branchname>" from $1 to get the repo address
-		    local repo="`echo $1 | sed -e "s:\(^.*/${tool}.git\).*:\1:"`"
-		    dryrun "git clone ${repo} ${local_snapshots}/${tool}.git"
+		    dryrun "git clone $1 ${srcdir}"
 		else
 		    if test ! -d ${local_snapshots}/${tool}.git; then
-			dryrun "git clone $1 ${srcdir}"
+			# Strip off the "/<branchname>" from $1 to get the repo address
+			local repo="`echo $1 | sed -e "s:\(^.*/${tool}.git\).*:\1:"`"
+			dryrun "git clone ${repo} ${local_snapshots}/${tool}.git"
 		    fi
 		    dryrun "git-new-workdir ${local_snapshots}/${tool}.git ${srcdir} ${branch}"
 		fi