]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commit
oeqa/selftest/oelib/buildhistory: git default branch
authorAdrian Freihofer <adrian.freihofer@gmail.com>
Sat, 10 Feb 2024 13:15:53 +0000 (14:15 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 13 Feb 2024 13:51:38 +0000 (13:51 +0000)
commit7df99843d8f31d8e0c2872ff625f4a5abf28f740
treee57ff93eee7e8dc3ca4638851f38acbeec139b9a
parent01d815aa2c0bea113fb79b51bf67c0ff90d57dd2
oeqa/selftest/oelib/buildhistory: git default branch

On hosts with git defaulting to main branch the following exception
occures:

File .../buildhistory.py", line 99, in test_compare_dict_blobs_default
  blob1 = self.repo.heads.master.commit.tree.blobs[0]
          ^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/git/util.py", line 1114, in __getattr__
  return list.__getattribute__(self, attr)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'IterableList' object has no attribute 'master'

Support main and master branch for these test cases.

Note: setting the default branch with --initial-branch requires git
version 2.28 or later. Some of the still supported host distros do not
provide this feature yet.

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/selftest/cases/oelib/buildhistory.py