diff options
-rw-r--r-- | bitbake/lib/bb/fetch2/git.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py index 384007c81f..af7c623ccb 100644 --- a/bitbake/lib/bb/fetch2/git.py +++ b/bitbake/lib/bb/fetch2/git.py | |||
@@ -245,7 +245,22 @@ class Git(FetchMethod): | |||
245 | if ud.bareclone: | 245 | if ud.bareclone: |
246 | cloneflags += " --mirror" | 246 | cloneflags += " --mirror" |
247 | 247 | ||
248 | runfetchcmd("git clone %s %s/ %s" % (cloneflags, ud.clonedir, destdir), d) | 248 | # Versions of git prior to 1.7.9.2 have issues where foo.git and foo get confused |
249 | # and you end up with some horrible union of the two when you attempt to clone it | ||
250 | # The least invasive workaround seems to be a symlink to the real directory to | ||
251 | # fool git into ignoring any .git version that may also be present. | ||
252 | # | ||
253 | # The issue is fixed in more recent versions of git so we can drop this hack in future | ||
254 | # when that version becomes common enough. | ||
255 | clonedir = ud.clonedir | ||
256 | if not ud.path.endswith(".git"): | ||
257 | indirectiondir = destdir[:-1] + ".indirectionsymlink" | ||
258 | if os.path.exists(indirectiondir): | ||
259 | os.remove(indirectiondir) | ||
260 | os.symlink(ud.clonedir, indirectiondir) | ||
261 | clonedir = indirectiondir | ||
262 | |||
263 | runfetchcmd("git clone %s %s/ %s" % (cloneflags, clonedir, destdir), d) | ||
249 | if not ud.nocheckout: | 264 | if not ud.nocheckout: |
250 | os.chdir(destdir) | 265 | os.chdir(destdir) |
251 | if subdir != "": | 266 | if subdir != "": |