Change summary
server/git/service.go | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
Detailed changes
@@ -50,8 +50,15 @@ type ServiceHandler func(ctx context.Context, cmd ServiceCommand) error
// gitServiceHandler is the default service handler using the git binary.
func gitServiceHandler(ctx context.Context, svc Service, scmd ServiceCommand) error {
- cmd := exec.CommandContext(ctx, "git", "-c", "uploadpack.allowFilter=true", svc.Name()) // nolint: gosec
+ cmd := exec.CommandContext(ctx, "git")
cmd.Dir = scmd.Dir
+ cmd.Args = append(cmd.Args, []string{
+ // Enable partial clones
+ "-c", "uploadpack.allowFilter=true",
+ // Enable push options
+ "-c", "receive.advertisePushOptions=true",
+ svc.Name(),
+ }...)
if len(scmd.Args) > 0 {
cmd.Args = append(cmd.Args, scmd.Args...)
}