summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/tests/fetch.py
diff options
context:
space:
mode:
authorAndré Draszik <andre.draszik@linaro.org>2024-02-16 16:25:00 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-02-19 12:00:59 +0000
commit577e73606acc34263d1e1eb1c76e2794d77a86cb (patch)
treef3064dbba0aa89947a8a35dbf1107992553898ae /bitbake/lib/bb/tests/fetch.py
parentb3d9663817c87f38277677b32aca43d2e8eb8aa2 (diff)
downloadpoky-577e73606acc34263d1e1eb1c76e2794d77a86cb.tar.gz
bitbake: tests/fetch: support git's safe.bareRepository
When git is configured with safe.bareRepository=explicit [1], the bitbake selftests fail miserably. LWN has an article about the problem that this configuration option addresses and why it is useful in [2]. It also seems that it is being rolled out in some environments as a default for users. In order to allow having this configuration turned on for a user's environment in general, the fetcher has to be tought to use --git-dir= for all relevent git operations. The alternative, implemented here, is to forcibly turn off that option for all git operations. In the future, we could look into converting these to using the --git-dir= command line argument instead. Link: https://git.kernel.org/pub/scm/git/git.git/tree/Documentation/config/safe.txt#n1 [1] Link: https://lwn.net/Articles/892755/ [2] (Bitbake rev: a45e14a7343e36101e45639931322e5649587f57) Signed-off-by: André Draszik <andre.draszik@linaro.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/tests/fetch.py')
-rw-r--r--bitbake/lib/bb/tests/fetch.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/bitbake/lib/bb/tests/fetch.py b/bitbake/lib/bb/tests/fetch.py
index 41e1d8cf10..bb30ed6513 100644
--- a/bitbake/lib/bb/tests/fetch.py
+++ b/bitbake/lib/bb/tests/fetch.py
@@ -416,9 +416,9 @@ class FetcherTest(unittest.TestCase):
416 416
417 def git(self, cmd, cwd=None): 417 def git(self, cmd, cwd=None):
418 if isinstance(cmd, str): 418 if isinstance(cmd, str):
419 cmd = 'git ' + cmd 419 cmd = 'git -c safe.bareRepository=all ' + cmd
420 else: 420 else:
421 cmd = ['git'] + cmd 421 cmd = ['git', '-c', 'safe.bareRepository=all'] + cmd
422 if cwd is None: 422 if cwd is None:
423 cwd = self.gitdir 423 cwd = self.gitdir
424 return bb.process.run(cmd, cwd=cwd)[0] 424 return bb.process.run(cmd, cwd=cwd)[0]