diff mbox

Fix git clone to get repo without branch name as part of the url.

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

Commit Message

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

The previous version had white space errors.

---
 lib/checkout.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Rob Savoye Oct. 8, 2013, 3:24 a.m. UTC | #1
On 10/07/2013 05:21 PM, Ryan S. Arnold wrote:
> From: "Ryan S. Arnold" <ryan.arnold@linaro.org>
>
> The previous version had white space errors.
  Applied and pushed.

    - rob -
diff mbox

Patch

diff --git a/lib/checkout.sh b/lib/checkout.sh
index 17e33ce..6e01bd2 100644
--- a/lib/checkout.sh
+++ b/lib/checkout.sh
@@ -82,7 +82,9 @@  checkout()
 		    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