diff options
author | Zhenhua Luo <zhenhua.luo@freescale.com> | 2014-01-07 18:45:34 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-01-07 13:42:55 +0000 |
commit | 100c8831a56eb1598837ffac78a1bac577f7efd4 (patch) | |
tree | 0e0903cd45b00df1a31d4a92df7b720eac3c2b96 /bitbake | |
parent | 1d3a139016f4403cf406cb6e96d95e665945fe93 (diff) | |
download | poky-100c8831a56eb1598837ffac78a1bac577f7efd4.tar.gz |
bitbake: 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.
(Bitbake rev: f594cb9f5a18dd0ab2342f96ffc6dba697b35f65)
Signed-off-by: Zhenhua Luo <zhenhua.luo@freescale.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/fetch2/git.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py index b4b9368d14..c323309684 100644 --- a/bitbake/lib/bb/fetch2/git.py +++ b/bitbake/lib/bb/fetch2/git.py | |||
@@ -101,6 +101,8 @@ class Git(FetchMethod): | |||
101 | 101 | ||
102 | ud.rebaseable = ud.parm.get("rebaseable","0") == "1" | 102 | ud.rebaseable = ud.parm.get("rebaseable","0") == "1" |
103 | 103 | ||
104 | ud.nobranch = ud.parm.get("nobranch","0") == "1" | ||
105 | |||
104 | # bareclone implies nocheckout | 106 | # bareclone implies nocheckout |
105 | ud.bareclone = ud.parm.get("bareclone","0") == "1" | 107 | ud.bareclone = ud.parm.get("bareclone","0") == "1" |
106 | if ud.bareclone: | 108 | if ud.bareclone: |
@@ -289,8 +291,13 @@ class Git(FetchMethod): | |||
289 | return True | 291 | return True |
290 | 292 | ||
291 | def _contains_ref(self, ud, d, name): | 293 | def _contains_ref(self, ud, d, name): |
292 | cmd = "%s branch --contains %s --list %s 2> /dev/null | wc -l" % ( | 294 | cmd = "" |
293 | ud.basecmd, ud.revisions[name], ud.branches[name]) | 295 | if ud.nobranch: |
296 | cmd = "%s log --pretty=oneline -n 1 %s -- 2> /dev/null | wc -l" % ( | ||
297 | ud.basecmd, ud.revisions[name]) | ||
298 | else: | ||
299 | cmd = "%s branch --contains %s --list %s 2> /dev/null | wc -l" % ( | ||
300 | ud.basecmd, ud.revisions[name], ud.branches[name]) | ||
294 | try: | 301 | try: |
295 | output = runfetchcmd(cmd, d, quiet=True) | 302 | output = runfetchcmd(cmd, d, quiet=True) |
296 | except bb.fetch2.FetchError: | 303 | except bb.fetch2.FetchError: |