mirror of
https://git.yoctoproject.org/poky
synced 2026-05-31 12:49:46 +00:00
bitbake: git: Use git branch for ancestor checks
Using git merge-base for checking for ancestors is nice but required git 1.8.0 which is not in many distrbutions yet. We therefore revert to a more ugly check using git branch --contains until such times as we can upgrade. (Bitbake rev: 31467c0afe0346502fcd18bd376f23ea76a27d61) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -283,12 +283,14 @@ class Git(FetchMethod):
|
|||||||
|
|
||||||
def _contains_ref(self, tag, branch, d):
|
def _contains_ref(self, tag, branch, d):
|
||||||
basecmd = data.getVar("FETCHCMD_git", d, True) or "git"
|
basecmd = data.getVar("FETCHCMD_git", d, True) or "git"
|
||||||
cmd = "%s merge-base --is-ancestorlog %s %s" % (basecmd, tag, branch)
|
cmd = "%s branch --contains %s --list %s 2> /dev/null | wc -l" % (basecmd, tag, branch)
|
||||||
try:
|
try:
|
||||||
output = runfetchcmd(cmd, d, quiet=True)
|
output = runfetchcmd(cmd, d, quiet=True)
|
||||||
except bb.fetch2.FetchError:
|
except bb.fetch2.FetchError:
|
||||||
return False
|
return False
|
||||||
return True
|
if len(output.split()) > 1:
|
||||||
|
raise bb.fetch2.FetchError("The command '%s' gave output with more then 1 line unexpectedly, output: '%s'" % (cmd, output))
|
||||||
|
return output.split()[0] != "0"
|
||||||
|
|
||||||
def _revision_key(self, url, ud, d, name):
|
def _revision_key(self, url, ud, d, name):
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user