summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhenhua Luo <zhenhua.luo@freescale.com>2014-01-07 18:45:34 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-01-07 13:34:50 +0000
commitf594cb9f5a18dd0ab2342f96ffc6dba697b35f65 (patch)
tree03345ca4854b023e49e0592139653f1876c33568
parent0636797d75874ce4577f29011d69c56a4c6b9e89 (diff)
downloadbitbake-f594cb9f5a18dd0ab2342f96ffc6dba697b35f65.tar.gz
bitbake: fetch2/git: add nobranch option for SRC_URI to skip SHA validating for branch
For rebased git tree, some commits doesn't exist in any branch, and such commits are valid in tag, the change is useful for such case. Signed-off-by: Zhenhua Luo <zhenhua.luo@freescale.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/fetch2/git.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py
index b4b9368d1..c32330968 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:
@@ -289,8 +291,13 @@ class Git(FetchMethod):
return True
def _contains_ref(self, ud, d, name):
- cmd = "%s branch --contains %s --list %s 2> /dev/null | wc -l" % (
- ud.basecmd, ud.revisions[name], ud.branches[name])
+ cmd = ""
+ if ud.nobranch:
+ cmd = "%s log --pretty=oneline -n 1 %s -- 2> /dev/null | wc -l" % (
+ ud.basecmd, ud.revisions[name])
+ else:
+ cmd = "%s branch --contains %s --list %s 2> /dev/null | wc -l" % (
+ ud.basecmd, ud.revisions[name], ud.branches[name])
try:
output = runfetchcmd(cmd, d, quiet=True)
except bb.fetch2.FetchError: