This is an automated email from the ASF dual-hosted git repository.

juergbi pushed a commit to branch juerg/git-tagger
in repository https://gitbox.apache.org/repos/asf/buildstream-plugins.git

commit 6844af3767d8dff453a53c56ddbb9cda23ce7443
Author: Jürg Billeter <[email protected]>
AuthorDate: Sun Aug 4 14:48:27 2024 +0200

    git.py: Add tagger to annotated tag
    
    `git hash-object` 2.40+ fails without a tagger entry.
    
            error: object fails fsck: missingTaggerEntry: invalid format - 
expected 'tagger' line
            fatal: refusing to create malformed object
    
    Only ancient versions of git created tag objects without tagger
    information.
    
    As the `ref` does not currently contain tagger information, this uses a
    placeholder value that matches `git fast-export --fake-missing-tagger`.
---
 src/buildstream_plugins/sources/git.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/buildstream_plugins/sources/git.py 
b/src/buildstream_plugins/sources/git.py
index 0449c4e..63aee45 100644
--- a/src/buildstream_plugins/sources/git.py
+++ b/src/buildstream_plugins/sources/git.py
@@ -654,7 +654,9 @@ class GitMirror(SourceFetcher):
             for tag, commit_ref, annotated in self.tags:
                 if annotated:
                     with TemporaryFile(dir=tmpdir) as tag_file:
-                        tag_data = "object {}\ntype commit\ntag 
{}\n".format(commit_ref, tag)
+                        tag_data = "object {}\ntype commit\ntag {}\ntagger 
Unspecified Tagger <unspecified-tagger> 0 +0000\n".format(
+                            commit_ref, tag
+                        )
                         tag_file.write(tag_data.encode("ascii"))
                         tag_file.seek(0, 0)
                         _, tag_ref = self.source.check_output(

Reply via email to