archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] lib/bb/tests/ set initial branch
@ 2023-05-15  6:46 peter
  0 siblings, 0 replies; only message in thread
From: peter @ 2023-05-15  6:46 UTC (permalink / raw)
  To: bitbake-devel; +Cc: Bergin, Peter, Peter Bergin, Peter Bergin

From: "Bergin, Peter" <>

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 <>
Signed-off-by: Peter Bergin <>
 lib/bb/tests/ | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/bb/tests/ b/lib/bb/tests/
index 532adb941..132cd8e80 100644
--- a/lib/bb/tests/
+++ b/lib/bb/tests/
@@ -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', ''], cwd=cwd):
             self.git(['config', '', ''], cwd=cwd)
         if not self.git(['config', ''], cwd=cwd):

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2023-05-15  6:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-15  6:46 [PATCH v2] lib/bb/tests/ set initial branch peter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).