diff options
author | Bergin, Peter <Peter.Bergin@windriver.com> | 2023-05-15 08:46:50 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-05-25 10:33:15 +0100 |
commit | 5c3b6b6fd1fbcdbbc89e94e4f3f9ed4789fbeede (patch) | |
tree | 69692fcf56c46ddc7d2f587eabd61a20f6955e47 /bitbake/lib/bb/tests | |
parent | 222c5668a6c1e24c8fac1b89296f0a39d30c9de7 (diff) | |
download | poky-5c3b6b6fd1fbcdbbc89e94e4f3f9ed4789fbeede.tar.gz |
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 <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>
Diffstat (limited to 'bitbake/lib/bb/tests')
-rw-r--r-- | bitbake/lib/bb/tests/fetch.py | 4 |
1 files changed, 4 insertions, 0 deletions
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): | |||
424 | 424 | ||
425 | def git_init(self, cwd=None): | 425 | def git_init(self, cwd=None): |
426 | self.git('init', cwd=cwd) | 426 | self.git('init', cwd=cwd) |
427 | # Explicitly set initial branch to master as | ||
428 | # a common setup is to use other default | ||
429 | # branch than master. | ||
430 | self.git(['checkout', '-b', 'master'], cwd=cwd) | ||
427 | if not self.git(['config', 'user.email'], cwd=cwd): | 431 | if not self.git(['config', 'user.email'], cwd=cwd): |
428 | self.git(['config', 'user.email', 'you@example.com'], cwd=cwd) | 432 | self.git(['config', 'user.email', 'you@example.com'], cwd=cwd) |
429 | if not self.git(['config', 'user.name'], cwd=cwd): | 433 | if not self.git(['config', 'user.name'], cwd=cwd): |