summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bitbake/lib/bb/fetch2/git.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py
index d0d68538e2..2a3c06fe4e 100644
--- a/bitbake/lib/bb/fetch2/git.py
+++ b/bitbake/lib/bb/fetch2/git.py
@@ -367,9 +367,13 @@ class Git(FetchMethod):
367 367
368 # If the repo still doesn't exist, fallback to cloning it 368 # If the repo still doesn't exist, fallback to cloning it
369 if not os.path.exists(ud.clonedir): 369 if not os.path.exists(ud.clonedir):
370 # We do this since git will use a "-l" option automatically for local urls where possible 370 # We do this since git will use a "-l" option automatically for local urls where possible,
371 # but it doesn't work when git/objects is a symlink, only works when it is a directory.
371 if repourl.startswith("file://"): 372 if repourl.startswith("file://"):
372 repourl = repourl[7:] 373 repourl_path = repourl[7:]
374 objects = os.path.join(repourl_path, 'objects')
375 if os.path.isdir(objects) and not os.path.islink(objects):
376 repourl = repourl_path
373 clone_cmd = "LANG=C %s clone --bare --mirror %s %s --progress" % (ud.basecmd, shlex.quote(repourl), ud.clonedir) 377 clone_cmd = "LANG=C %s clone --bare --mirror %s %s --progress" % (ud.basecmd, shlex.quote(repourl), ud.clonedir)
374 if ud.proto.lower() != 'file': 378 if ud.proto.lower() != 'file':
375 bb.fetch2.check_network_access(d, clone_cmd, ud.url) 379 bb.fetch2.check_network_access(d, clone_cmd, ud.url)