[bitbake-devel] [PATCH] bitbake: fetch2/git: add nobranch option for SRC_URI to skip validating SHA

Zhenhua Luo zhenhua.luo at freescale.com
Tue Jan 7 03:21:06 UTC 2014


For rebased git tree, some commits can be found in tag rather than branch, the change
is useful for such case.

Signed-off-by: Zhenhua Luo <zhenhua.luo at freescale.com>
---
 lib/bb/fetch2/git.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py
index b4b9368..6d74dbb 100644
--- a/lib/bb/fetch2/git.py
+++ b/lib/bb/fetch2/git.py
@@ -101,6 +101,8 @@ class Git(FetchMethod):
 
         ud.rebaseable = ud.parm.get("rebaseable","0") == "1"
 
+        ud.nobranch = ud.parm.get("nobranch","0") == "1"
+
         # bareclone implies nocheckout
         ud.bareclone = ud.parm.get("bareclone","0") == "1"
         if ud.bareclone:
@@ -217,7 +219,7 @@ class Git(FetchMethod):
             ud.repochanged = True
         os.chdir(ud.clonedir)
         for name in ud.names:
-            if not self._contains_ref(ud, d, name):
+            if not ud.nobranch and not self._contains_ref(ud, d, name):
                 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):
-- 
1.8.4.2





More information about the bitbake-devel mailing list