Commit 1313bc17 authored by Rubén Dávila's avatar Rubén Dávila

Add support for GitConfigOptions required for git-receive-pack command

parent 75f39661
...@@ -107,6 +107,8 @@ type Response struct { ...@@ -107,6 +107,8 @@ type Response struct {
// RepoPath is the full path on disk to the Git repository the request is // RepoPath is the full path on disk to the Git repository the request is
// about // about
RepoPath string RepoPath string
// GitConfigOptions holds the custom options that we want to pass to the git command
GitConfigOptions []string
// StoreLFSPath is provided by the GitLab Rails application to mark where the tmp file should be placed. // StoreLFSPath is provided by the GitLab Rails application to mark where the tmp file should be placed.
// This field is deprecated. GitLab will use TempPath instead // This field is deprecated. GitLab will use TempPath instead
StoreLFSPath string StoreLFSPath string
......
...@@ -54,7 +54,7 @@ func handleReceivePackWithGitaly(ctx context.Context, a *api.Response, clientReq ...@@ -54,7 +54,7 @@ func handleReceivePackWithGitaly(ctx context.Context, a *api.Response, clientReq
return fmt.Errorf("smarthttp.ReceivePack: %v", err) return fmt.Errorf("smarthttp.ReceivePack: %v", err)
} }
if err := smarthttp.ReceivePack(ctx, &a.Repository, a.GL_ID, a.GL_USERNAME, a.GL_REPOSITORY, clientRequest, clientResponse, gitProtocol); err != nil { if err := smarthttp.ReceivePack(ctx, &a.Repository, a.GL_ID, a.GL_USERNAME, a.GL_REPOSITORY, a.GitConfigOptions, clientRequest, clientResponse, gitProtocol); err != nil {
return fmt.Errorf("smarthttp.ReceivePack: %v", err) return fmt.Errorf("smarthttp.ReceivePack: %v", err)
} }
......
...@@ -43,18 +43,19 @@ func infoRefsReader(stream infoRefsClient) io.Reader { ...@@ -43,18 +43,19 @@ func infoRefsReader(stream infoRefsClient) io.Reader {
}) })
} }
func (client *SmartHTTPClient) ReceivePack(ctx context.Context, repo *pb.Repository, glId string, glUsername string, glRepository string, clientRequest io.Reader, clientResponse io.Writer, gitProtocol string) error { func (client *SmartHTTPClient) ReceivePack(ctx context.Context, repo *pb.Repository, glId string, glUsername string, glRepository string, gitConfigOptions []string, clientRequest io.Reader, clientResponse io.Writer, gitProtocol string) error {
stream, err := client.PostReceivePack(ctx) stream, err := client.PostReceivePack(ctx)
if err != nil { if err != nil {
return err return err
} }
rpcRequest := &pb.PostReceivePackRequest{ rpcRequest := &pb.PostReceivePackRequest{
Repository: repo, Repository: repo,
GlId: glId, GlId: glId,
GlUsername: glUsername, GlUsername: glUsername,
GlRepository: glRepository, GlRepository: glRepository,
GitProtocol: gitProtocol, GitConfigOptions: gitConfigOptions,
GitProtocol: gitProtocol,
} }
if err := stream.Send(rpcRequest); err != nil { if err := stream.Send(rpcRequest); err != nil {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment