]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Copy also .git file for submodules
authorFabian Wiesel <fabian.wiesel@sap.com>
Mon, 10 Oct 2022 11:51:53 +0000 (11:51 +0000)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 13 Oct 2022 14:55:35 +0000 (16:55 +0200)
To properly get the commit history of a submodule,
we need the .git file pointing to the submodule
in the top-level git directory

mkosi/__init__.py

index 9418aad175c6ff57b50c1691ed7375401b965626..774ad08c89a4384b700cfae6f5aace330b6b391c 100644 (file)
@@ -3303,6 +3303,10 @@ def copy_git_files(src: Path, dest: Path, *, source_file_transfer: SourceFileTra
         files |= {sm / x.decode("utf-8") for x in c.stdout.rstrip(b"\0").split(b"\0")}
         files -= submodules
 
+        # Add the .git submodule file well.
+        if source_file_transfer == SourceFileTransfer.copy_git_more:
+            files.add(os.path.join(sm, ".git"))
+
     del c
 
     for path in files: