mirror of
https://git.yoctoproject.org/poky
synced 2026-04-21 03:32:12 +02:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
b3d9663817
commit
577e73606a
@@ -416,9 +416,9 @@ class FetcherTest(unittest.TestCase):
|
||||
|
||||
def git(self, cmd, cwd=None):
|
||||
if isinstance(cmd, str):
|
||||
cmd = 'git ' + cmd
|
||||
cmd = 'git -c safe.bareRepository=all ' + cmd
|
||||
else:
|
||||
cmd = ['git'] + cmd
|
||||
cmd = ['git', '-c', 'safe.bareRepository=all'] + cmd
|
||||
if cwd is None:
|
||||
cwd = self.gitdir
|
||||
return bb.process.run(cmd, cwd=cwd)[0]
|
||||
|
||||
Reference in New Issue
Block a user