aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBergin, Peter <Peter.Bergin@windriver.com>2023-05-15 08:46:50 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-05-25 10:32:20 +0100
commit5bcd213c23da30a84baba88b775b1740e6bb77d0 (patch)
tree441e6f164caf19bbe68c516258c0703143549cb6
parenta98b8dbb5fbd937a9530793485cf7c68fdd75cc2 (diff)
downloadbitbake-contrib-5bcd213c23da30a84baba88b775b1740e6bb77d0.tar.gz
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'. Signed-off-by: Peter Bergin <peter.bergin@windriver.com> Signed-off-by: Peter Bergin <peter@berginkonsult.se> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/tests/fetch.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/bb/tests/fetch.py b/lib/bb/tests/fetch.py
index 256f0fb78..d23012027 100644
--- a/lib/bb/tests/fetch.py
+++ b/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):