diff options
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/fetch2/git.py | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py index d396d2458a..9f79d47762 100644 --- a/bitbake/lib/bb/fetch2/git.py +++ b/bitbake/lib/bb/fetch2/git.py | |||
@@ -121,15 +121,18 @@ class Git(Fetch): | |||
121 | 121 | ||
122 | os.chdir(ud.clonedir) | 122 | os.chdir(ud.clonedir) |
123 | # Update the checkout if needed | 123 | # Update the checkout if needed |
124 | needupdate = False | ||
124 | for name in ud.names: | 125 | for name in ud.names: |
125 | if not self._contains_ref(ud.revisions[name], d): | 126 | if not self._contains_ref(ud.revisions[name], d): |
126 | # Remove all but the .git directory | 127 | needupdate = True |
127 | bb.fetch2.check_network_access(d, "git fetch %s%s" %(ud.host, ud.path)) | 128 | if needupdate: |
128 | runfetchcmd("%s fetch %s://%s%s%s %s" % (ud.basecmd, ud.proto, username, ud.host, ud.path, ud.branches[name]), d) | 129 | bb.fetch2.check_network_access(d, "git fetch %s%s" % (ud.host, ud.path)) |
129 | runfetchcmd("%s fetch --tags %s://%s%s%s" % (ud.basecmd, ud.proto, username, ud.host, ud.path), d) | 130 | runfetchcmd("%s remote rm origin" % ud.basecmd, d) |
130 | runfetchcmd("%s prune-packed" % ud.basecmd, d) | 131 | runfetchcmd("%s remote add origin %s://%s%s%s" % (ud.basecmd, ud.proto, username, ud.host, ud.path), d) |
131 | runfetchcmd("%s pack-redundant --all | xargs -r rm" % ud.basecmd, d) | 132 | runfetchcmd("%s fetch --all -t" % ud.basecmd, d) |
132 | ud.repochanged = True | 133 | runfetchcmd("%s prune-packed" % ud.basecmd, d) |
134 | runfetchcmd("%s pack-redundant --all | xargs -r rm" % ud.basecmd, d) | ||
135 | ud.repochanged = True | ||
133 | 136 | ||
134 | def build_mirror_data(self, url, ud, d): | 137 | def build_mirror_data(self, url, ud, d): |
135 | # Generate a mirror tarball if needed | 138 | # Generate a mirror tarball if needed |