diff mbox series

fetch2/git: Install Git LFS in local repository config

Message ID 20240315185533.71921-1-derek.erdmann@sonos.com
State Accepted, archived
Commit 328ca4de8422be514fa0d0c9e3cfd36bb9d3e9a7
Headers show
Series fetch2/git: Install Git LFS in local repository config | expand

Commit Message

Derek Erdmann March 15, 2024, 6:55 p.m. UTC
Git uses a lock file to prevent concurrent modifications to the global
config, so if unpack tasks for different recipes try to run "git lfs
install" simultaneously the operation can fail:

    error: could not lock config file /home/build/.gitconfig: File exists exit status 255
    Run `git lfs install --force` to reset Git configuration.

Adding "--local" sets the smudge and clean filters in the local
repository's config instead of modifying the user's global config.

Signed-off-by: Derek Erdmann <derek.erdmann@sonos.com>
---
 lib/bb/fetch2/git.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py
index b9dc576d..ba1556e7 100644
--- a/lib/bb/fetch2/git.py
+++ b/lib/bb/fetch2/git.py
@@ -673,7 +673,7 @@  class Git(FetchMethod):
             elif not need_lfs:
                 bb.note("Repository %s has LFS content but it is not being fetched" % (repourl))
             else:
-                runfetchcmd("%s lfs install" % ud.basecmd, d, workdir=destdir)
+                runfetchcmd("%s lfs install --local" % ud.basecmd, d, workdir=destdir)
 
         if not ud.nocheckout:
             if subpath: