summaryrefslogtreecommitdiffstats
path: root/lib/bb/fetch2
diff options
context:
space:
mode:
authorJason Wessel <jason.wessel@windriver.com>2012-06-14 16:44:02 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-06-21 13:16:35 +0100
commit2bab2cc3ffe67ee2a308074a6e4c2c7be5636d2f (patch)
treebfee3a9b2ab6d5a179b329cff2b7483b28600a39 /lib/bb/fetch2
parent6c0da26adbdcaa0c56737bacddb61678a9095e32 (diff)
downloadbitbake-2bab2cc3ffe67ee2a308074a6e4c2c7be5636d2f.tar.gz
fetch2/git.py: Optimize clone fall back when it is local
A file:// url should use "clone -l" to greatly speed up the clone in the case of a kernel when it is local. Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/fetch2')
-rw-r--r--lib/bb/fetch2/git.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py
index ecc5e0ded..07d722a15 100644
--- a/lib/bb/fetch2/git.py
+++ b/lib/bb/fetch2/git.py
@@ -188,7 +188,9 @@ class Git(FetchMethod):
# If the repo still doesn't exist, fallback to cloning it
if not os.path.exists(ud.clonedir):
- clone_cmd = "%s clone --bare --mirror %s %s" % (ud.basecmd, repourl, ud.clonedir)
+ if repourl.startswith("file://"):
+ repourl = repourl[7:]
+ clone_cmd = "%s clone -l --bare --mirror %s %s" % (ud.basecmd, repourl, ud.clonedir)
if ud.proto.lower() != 'file':
bb.fetch2.check_network_access(d, clone_cmd)
runfetchcmd(clone_cmd, d)