diff options
Diffstat (limited to 'bitbake/lib/bb/fetch2/git.py')
-rw-r--r-- | bitbake/lib/bb/fetch2/git.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py index 11cda2007d..55dd084abc 100644 --- a/bitbake/lib/bb/fetch2/git.py +++ b/bitbake/lib/bb/fetch2/git.py | |||
@@ -348,6 +348,13 @@ class Git(FetchMethod): | |||
348 | def tarball_need_update(self, ud): | 348 | def tarball_need_update(self, ud): |
349 | return ud.write_tarballs and not os.path.exists(ud.fullmirror) | 349 | return ud.write_tarballs and not os.path.exists(ud.fullmirror) |
350 | 350 | ||
351 | def update_mirror_links(self, ud, origud): | ||
352 | super().update_mirror_links(ud, origud) | ||
353 | # When using shallow mode, add a symlink to the original fullshallow | ||
354 | # path to ensure a valid symlink even in the `PREMIRRORS` case | ||
355 | if ud.shallow and not os.path.exists(origud.fullshallow): | ||
356 | self.ensure_symlink(ud.localpath, origud.fullshallow) | ||
357 | |||
351 | def try_premirror(self, ud, d): | 358 | def try_premirror(self, ud, d): |
352 | # If we don't do this, updating an existing checkout with only premirrors | 359 | # If we don't do this, updating an existing checkout with only premirrors |
353 | # is not possible | 360 | # is not possible |
@@ -639,7 +646,7 @@ class Git(FetchMethod): | |||
639 | extra_refs.append(r) | 646 | extra_refs.append(r) |
640 | 647 | ||
641 | for ref in extra_refs: | 648 | for ref in extra_refs: |
642 | ref_fetch = os.path.basename(ref) | 649 | ref_fetch = ref.replace('refs/heads/', '').replace('refs/remotes/origin/', '').replace('refs/tags/', '') |
643 | runfetchcmd("%s fetch origin --depth 1 %s" % (ud.basecmd, ref_fetch), d, workdir=dest) | 650 | runfetchcmd("%s fetch origin --depth 1 %s" % (ud.basecmd, ref_fetch), d, workdir=dest) |
644 | revision = runfetchcmd("%s rev-parse FETCH_HEAD" % ud.basecmd, d, workdir=dest) | 651 | revision = runfetchcmd("%s rev-parse FETCH_HEAD" % ud.basecmd, d, workdir=dest) |
645 | runfetchcmd("%s update-ref %s %s" % (ud.basecmd, ref, revision), d, workdir=dest) | 652 | runfetchcmd("%s update-ref %s %s" % (ud.basecmd, ref, revision), d, workdir=dest) |