summaryrefslogtreecommitdiffstats
path: root/integrations/git_helper_for_declarative_test.go
diff options
context:
space:
mode:
authorGusted <williamzijl7@hotmail.com>2022-01-23 21:19:32 +0000
committerGitHub <noreply@github.com>2022-01-23 22:19:32 +0100
commitc2e13fb763ec4764f8ebbeb25b190b48ac7b99ad (patch)
tree29572d3dcc4666afe7056847578176370897fb61 /integrations/git_helper_for_declarative_test.go
parent5e5740af69cb0f44ff0c1576a2387388d75bb4c2 (diff)
downloadgitea-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 'integrations/git_helper_for_declarative_test.go')
-rw-r--r--integrations/git_helper_for_declarative_test.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/integrations/git_helper_for_declarative_test.go b/integrations/git_helper_for_declarative_test.go
index b13c912fd7..de96f633c0 100644
--- a/integrations/git_helper_for_declarative_test.go
+++ b/integrations/git_helper_for_declarative_test.go
@@ -122,6 +122,17 @@ func doGitClone(dstLocalPath string, u *url.URL) func(*testing.T) {
}
}
+func doPartialGitClone(dstLocalPath string, u *url.URL) func(*testing.T) {
+ return func(t *testing.T) {
+ assert.NoError(t, git.CloneWithArgs(context.Background(), u.String(), dstLocalPath, allowLFSFilters(), git.CloneRepoOptions{
+ Filter: "blob:none",
+ }))
+ exist, err := util.IsExist(filepath.Join(dstLocalPath, "README.md"))
+ assert.NoError(t, err)
+ assert.True(t, exist)
+ }
+}
+
func doGitCloneFail(u *url.URL) func(*testing.T) {
return func(t *testing.T) {
tmpDir, err := os.MkdirTemp("", "doGitCloneFail")