]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Set $HOME to the user's home directory in sync scripts
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 20 Mar 2024 12:08:21 +0000 (13:08 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 20 Mar 2024 12:48:34 +0000 (13:48 +0100)
Makes sure git can find the user's git configuration.

mkosi/__init__.py

index 98fc92947f9bbc7bff3a687f099a00a9c3ce1fa8..743feefd2d0099152e45fa59653f09e40776a1e7 100644 (file)
@@ -462,6 +462,7 @@ def run_sync_scripts(context: Context) -> None:
                 # git repository and might need to modify the git config in the parent git repository when submodules
                 # are in use as well.
                 mounts += [Mount(p, p)]
+                env["HOME"] = os.fspath(p)
             if (p := Path(f"/run/user/{INVOKING_USER.uid}")).exists():
                 mounts += [Mount(p, p, ro=True)]