bitbake-devel.lists.openembedded.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] lib/bb/tests/fetch.py: 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" <Peter.Bergin@windriver.com>

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>
---
 lib/bb/tests/fetch.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/bb/tests/fetch.py b/lib/bb/tests/fetch.py
index 532adb941..132cd8e80 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):
-- 
2.34.1



^ 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/fetch.py: 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).