summaryrefslogtreecommitdiffstats
path: root/lib/bb/fetch2/git.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-12-05 15:21:38 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-12-05 16:26:47 +0000
commita9112a102a89049cda597dad449e922c9e957a5d (patch)
treeb2032ca0050d82b73b3acb769cb449822b81891f /lib/bb/fetch2/git.py
parentf9d24f55a5ffa9257e7ba3257be1210687513733 (diff)
downloadbitbake-a9112a102a89049cda597dad449e922c9e957a5d.tar.gz
fetch2/git: Add sanity check to ensure we really did fetch the correct revisions
The fetcher made the rather bold assumption that if it fetched from the upstream, the revisions were present and correct. These checks are fast and ensure that really is the case. The avoids accidental network accessed and missing branch configuration problems. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/fetch2/git.py')
-rw-r--r--lib/bb/fetch2/git.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py
index a9470e40d..2b9f8af94 100644
--- a/lib/bb/fetch2/git.py
+++ b/lib/bb/fetch2/git.py
@@ -213,6 +213,9 @@ class Git(FetchMethod):
runfetchcmd("%s prune-packed" % ud.basecmd, d)
runfetchcmd("%s pack-redundant --all | xargs -r rm" % ud.basecmd, d)
ud.repochanged = True
+ for name in ud.names:
+ if not self._contains_ref(ud.revisions[name], ud.branches[name], d):
+ raise bb.fetch2.FetchError("Unable to find revision %s in branch %s even from upstream" % (ud.revisions[name], ud.branches[name]))
def build_mirror_data(self, ud, d):
# Generate a mirror tarball if needed