Read-only mirror — the public repositories of the Forgejo instance, refreshed every 10 minutes. The live instance (fg.dieschoenewolke.de) is reachable only over the VPN; clone here with https://git.dieschoenewolke.de/git/<owner>/<repo>.git.
summaryrefslogtreecommitdiff
path: root/__test__
diff options
context:
space:
mode:
authorFinley Garton <35561611+finleygn@users.noreply.github.com>2023-09-22 18:30:36 +0100
committerGitHub <noreply@github.com>2023-09-22 13:30:36 -0400
commit1963f77c07df3ab7f9fd71f348c9f4c1b94d1416 (patch)
treee6d3ad1f11ed2694acc6868db9a78d81db0cc574 /__test__
parent013e4dd1057d3478e90c162d5c1f49bd989999a4 (diff)
Add support for partial checkout filters (#1396)
* added filter option & tests * added build file * fix test oversight * added exit 1 * updated docs to specify override * undo unneeded readme change * set to undefined rather than empty string * run git config in correct di --------- Co-authored-by: Cory Miller <13227161+cory-miller@users.noreply.github.com>
Diffstat (limited to '__test__')
-rw-r--r--__test__/git-auth-helper.test.ts1
-rw-r--r--__test__/input-helper.test.ts1
-rwxr-xr-x__test__/verify-fetch-filter.sh16
3 files changed, 18 insertions, 0 deletions
diff --git a/__test__/git-auth-helper.test.ts b/__test__/git-auth-helper.test.ts
index a0cff63..411faed 100644
--- a/__test__/git-auth-helper.test.ts
+++ b/__test__/git-auth-helper.test.ts
@@ -802,6 +802,7 @@ async function setup(testName: string): Promise<void> {
authToken: 'some auth token',
clean: true,
commit: '',
+ filter: undefined,
sparseCheckout: [],
sparseCheckoutConeMode: true,
fetchDepth: 1,
diff --git a/__test__/input-helper.test.ts b/__test__/input-helper.test.ts
index 21932ca..9514cb4 100644
--- a/__test__/input-helper.test.ts
+++ b/__test__/input-helper.test.ts
@@ -79,6 +79,7 @@ describe('input-helper tests', () => {
expect(settings.clean).toBe(true)
expect(settings.commit).toBeTruthy()
expect(settings.commit).toBe('1234567890123456789012345678901234567890')
+ expect(settings.filter).toBe(undefined)
expect(settings.sparseCheckout).toBe(undefined)
expect(settings.sparseCheckoutConeMode).toBe(true)
expect(settings.fetchDepth).toBe(1)
diff --git a/__test__/verify-fetch-filter.sh b/__test__/verify-fetch-filter.sh
new file mode 100755
index 0000000..4fc9d9e
--- /dev/null
+++ b/__test__/verify-fetch-filter.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+# Verify .git folder
+if [ ! -d "./fetch-filter/.git" ]; then
+ echo "Expected ./fetch-filter/.git folder to exist"
+ exit 1
+fi
+
+# Verify .git/config contains partialclonefilter
+
+CLONE_FILTER=$(git -C fetch-filter config --local --get remote.origin.partialclonefilter)
+
+if [ "$CLONE_FILTER" != "blob:none" ]; then
+ echo "Expected ./fetch-filter/.git/config to have 'remote.origin.partialclonefilter' set to 'blob:none'"
+ exit 1
+fi