Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support git push options #341

Merged
merged 1 commit into from
Jul 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion server/git/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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...)
}
Expand Down
Loading