Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Cai <jcai@gitlab.com>2023-06-13 21:32:09 +0300
committerJohn Cai <jcai@gitlab.com>2023-06-20 18:10:53 +0300
commitaff59d7a274838f66b941965d732ff34a78cc9d4 (patch)
tree463c0ef742dd3d61d797ba18b3f2e6e91f2233ed
parent0a8aa95ec743c3c2cdbd3a0b7dac5a0d7ada815e (diff)
git Add WithGitalyGPG() as a command option
Add a command option to include gitaly-gpg as the gpg binary.
-rw-r--r--internal/git/command_options.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/internal/git/command_options.go b/internal/git/command_options.go
index e30ff1a45..4ce59129f 100644
--- a/internal/git/command_options.go
+++ b/internal/git/command_options.go
@@ -222,6 +222,21 @@ func WithInternalFetchWithSidechannel(req *gitalypb.SSHUploadPackWithSidechannel
return withInternalFetch(req, true)
}
+// WithGitalyGPG sets gpg.prgoram to gitaly-gpg for commit signing
+func WithGitalyGPG() CmdOpt {
+ return func(_ context.Context, cfg config.Cfg, _ CommandFactory, c *cmdCfg) error {
+ c.globals = append(
+ c.globals,
+ &ConfigPair{
+ Key: "gpg.program",
+ Value: cfg.BinaryPath("gitaly-gpg"),
+ },
+ )
+
+ return nil
+ }
+}
+
type repoScopedRequest interface {
proto.Message
GetRepository() *gitalypb.Repository