From 5c3b6b6fd1fbcdbbc89e94e4f3f9ed4789fbeede Mon Sep 17 00:00:00 2001 From: "Bergin, Peter" Date: Mon, 15 May 2023 08:46:50 +0200 Subject: bitbake: lib/bb/tests/fetch.py: set initial branch If you have a host where the git config for initial branch name is something else than 'master' the unittest will fail as they assume the default branch name is 'master'. Fix this by explicitly set the intial branch name at 'git init'. (Bitbake rev: 5bcd213c23da30a84baba88b775b1740e6bb77d0) Signed-off-by: Peter Bergin Signed-off-by: Peter Bergin Signed-off-by: Alexandre Belloni Signed-off-by: Richard Purdie --- bitbake/lib/bb/tests/fetch.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'bitbake/lib/bb/tests/fetch.py') diff --git a/bitbake/lib/bb/tests/fetch.py b/bitbake/lib/bb/tests/fetch.py index 256f0fb788..d230120271 100644 --- a/bitbake/lib/bb/tests/fetch.py +++ b/bitbake/lib/bb/tests/fetch.py @@ -424,6 +424,10 @@ class FetcherTest(unittest.TestCase): def git_init(self, cwd=None): self.git('init', cwd=cwd) + # Explicitly set initial branch to master as + # a common setup is to use other default + # branch than master. + self.git(['checkout', '-b', 'master'], cwd=cwd) if not self.git(['config', 'user.email'], cwd=cwd): self.git(['config', 'user.email', 'you@example.com'], cwd=cwd) if not self.git(['config', 'user.name'], cwd=cwd): -- cgit v1.2.3-54-g00ecf