Fix partial cloning a repo (#18373)
- Pass the Global command args into serviceRPC. - Fixes error with partial cloning. - Add partial clone test - Include diff Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
parent
5e5740af69
commit
c2e13fb763
6 changed files with 24 additions and 4 deletions
|
@ -1376,7 +1376,7 @@ func GetDiff(gitRepo *git.Repository, opts *DiffOptions, files ...string) (*Diff
|
|||
}()
|
||||
|
||||
go func(ctx context.Context, diffArgs []string, repoPath string, writer *io.PipeWriter) {
|
||||
cmd := git.NewCommandContextNoGlobals(ctx, diffArgs...)
|
||||
cmd := git.NewCommandContext(ctx, diffArgs...)
|
||||
cmd.SetDescription(fmt.Sprintf("GetDiffRange [repo_path: %s]", repoPath))
|
||||
if err := cmd.RunWithContext(&git.RunContext{
|
||||
Timeout: time.Duration(setting.Git.Timeout.Default) * time.Second,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue