diff options
| author | 2026-06-07 17:24:36 +0000 | |
|---|---|---|
| committer | 2026-06-07 17:24:36 +0000 | |
| commit | 0c0e1674f4b5c6862e9c472ba3b0fcd84c194fc4 (patch) | |
| tree | 2b8e2667094938ae539985b71f51d559d9e077cb /internal/testgit/commit.go | |
| parent | TODO: hash function transition (diff) | |
| signature | No signature | |
internal/testgit: Add -S to CommitTree
Diffstat (limited to 'internal/testgit/commit.go')
| -rw-r--r-- | internal/testgit/commit.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/internal/testgit/commit.go b/internal/testgit/commit.go index b1838e71..78a83e05 100644 --- a/internal/testgit/commit.go +++ b/internal/testgit/commit.go @@ -15,6 +15,10 @@ type CommitTreeOptions struct { Committer Identity AuthorDate string CommitterDate string + + // Sign requests a signed commit via git commit-tree -S, + // using the gpg.format and user.signingkey configured on the repo. + Sign bool } // CommitTree creates a commit object from a tree and optional parents, @@ -34,6 +38,10 @@ func (repo *Repo) CommitTree( args = append(args, "-p", parent.String()) } + if opts.Sign { + args = append(args, "-S") + } + args = append(args, "-m", opts.Message, "--end-of-options", tree.String()) cmd := repo.command(tb, "git", args...) |
