summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2011-02-03 20:16:05 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-02-10 23:36:53 +0000
commit06ca9563a619116f37989da6e54fef821a662215 (patch)
tree6f7562c38550e60f929bb1c9ad3009e4c48b686d /lib
parent9188a6a7db68370cc2d26eb1884f76c99e6b596e (diff)
downloadbitbake-06ca9563a619116f37989da6e54fef821a662215.tar.gz
bitbake/fetch2/git: Ensure deleted branches upstream are removed, all branch tags are forced to the upstream revisions and all revisions and tags are always fetched
(From Poky rev: dfc5faf717ac1f917af398097d5295128548a55d) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/bb/fetch2/git.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py
index d396d2458..9f79d4776 100644
--- a/lib/bb/fetch2/git.py
+++ b/lib/bb/fetch2/git.py
@@ -121,15 +121,18 @@ class Git(Fetch):
os.chdir(ud.clonedir)
# Update the checkout if needed
+ needupdate = False
for name in ud.names:
if not self._contains_ref(ud.revisions[name], d):
- # Remove all but the .git directory
- bb.fetch2.check_network_access(d, "git fetch %s%s" %(ud.host, ud.path))
- runfetchcmd("%s fetch %s://%s%s%s %s" % (ud.basecmd, ud.proto, username, ud.host, ud.path, ud.branches[name]), d)
- runfetchcmd("%s fetch --tags %s://%s%s%s" % (ud.basecmd, ud.proto, username, ud.host, ud.path), d)
- runfetchcmd("%s prune-packed" % ud.basecmd, d)
- runfetchcmd("%s pack-redundant --all | xargs -r rm" % ud.basecmd, d)
- ud.repochanged = True
+ needupdate = True
+ if needupdate:
+ bb.fetch2.check_network_access(d, "git fetch %s%s" % (ud.host, ud.path))
+ runfetchcmd("%s remote rm origin" % ud.basecmd, d)
+ runfetchcmd("%s remote add origin %s://%s%s%s" % (ud.basecmd, ud.proto, username, ud.host, ud.path), d)
+ runfetchcmd("%s fetch --all -t" % ud.basecmd, d)
+ runfetchcmd("%s prune-packed" % ud.basecmd, d)
+ runfetchcmd("%s pack-redundant --all | xargs -r rm" % ud.basecmd, d)
+ ud.repochanged = True
def build_mirror_data(self, url, ud, d):
# Generate a mirror tarball if needed