diff options
author | Gusted <williamzijl7@hotmail.com> | 2022-01-23 21:19:32 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-23 22:19:32 +0100 |
commit | c2e13fb763ec4764f8ebbeb25b190b48ac7b99ad (patch) | |
tree | 29572d3dcc4666afe7056847578176370897fb61 /modules/git/repo.go | |
parent | 5e5740af69cb0f44ff0c1576a2387388d75bb4c2 (diff) | |
download | gitea-c2e13fb763ec4764f8ebbeb25b190b48ac7b99ad.tar.gz gitea-c2e13fb763ec4764f8ebbeb25b190b48ac7b99ad.zip |
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>
Diffstat (limited to 'modules/git/repo.go')
-rw-r--r-- | modules/git/repo.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/git/repo.go b/modules/git/repo.go index 6368c6459b..5636405118 100644 --- a/modules/git/repo.go +++ b/modules/git/repo.go @@ -101,6 +101,7 @@ type CloneRepoOptions struct { Shared bool NoCheckout bool Depth int + Filter string } // Clone clones original repository to target path. @@ -136,7 +137,9 @@ func CloneWithArgs(ctx context.Context, from, to string, args []string, opts Clo if opts.Depth > 0 { cmd.AddArguments("--depth", strconv.Itoa(opts.Depth)) } - + if opts.Filter != "" { + cmd.AddArguments("--filter", opts.Filter) + } if len(opts.Branch) > 0 { cmd.AddArguments("-b", opts.Branch) } |