diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2026-01-12 14:05:51 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2026-01-12 14:05:51 +0000 |
| commit | 817ce37a5ee8d6279a44cf8cce3cc6a1e4bab576 (patch) | |
| tree | 9fd5a6d3969afc33baa900bdab25bff81c5a83a4 /src/git/subprocess.rs | |
| parent | f25eea8cc3b940cbcaa96224485826bfaae82449 (diff) | |
feat: add uploadpack.allowFilter support for GRASP-01 compliance
Add mandatory uploadpack.allowFilter capability to support partial clones
and fetches as required by GRASP-01 specification. This enables efficient
git operations for bandwidth-constrained clients (e.g., browser-based git
clients like git-natural-api).
Changes:
- Add uploadpack.allowFilter=true to git subprocess configuration
- Update SmartGitServer test helper with filter support
- Add integration tests for filter capability advertisement and functionality
- Update documentation to reflect filter as required capability
Tests verify:
- Filter capability is advertised in info/refs
- Filtered clones with blob:none work correctly
- Filtered fetches with tree:0 work correctly
Diffstat (limited to 'src/git/subprocess.rs')
| -rw-r--r-- | src/git/subprocess.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/git/subprocess.rs b/src/git/subprocess.rs index acee726..37fa382 100644 --- a/src/git/subprocess.rs +++ b/src/git/subprocess.rs | |||
| @@ -33,13 +33,16 @@ impl GitSubprocess { | |||
| 33 | 33 | ||
| 34 | let mut cmd = Command::new("git"); | 34 | let mut cmd = Command::new("git"); |
| 35 | 35 | ||
| 36 | // GRASP-01 requirement: MUST include `allow-reachable-sha1-in-want` and | 36 | // GRASP-01 requirement: MUST include `allow-reachable-sha1-in-want`, |
| 37 | // `allow-tip-sha1-in-want` in advertisement and serve available oids. | 37 | // `allow-tip-sha1-in-want`, and `uploadpack.allowFilter` in advertisement |
| 38 | // and serve available oids and filtered requests. | ||
| 38 | // These config options must be passed before the command name. | 39 | // These config options must be passed before the command name. |
| 39 | cmd.arg("-c"); | 40 | cmd.arg("-c"); |
| 40 | cmd.arg("uploadpack.allowReachableSHA1InWant=true"); | 41 | cmd.arg("uploadpack.allowReachableSHA1InWant=true"); |
| 41 | cmd.arg("-c"); | 42 | cmd.arg("-c"); |
| 42 | cmd.arg("uploadpack.allowTipSHA1InWant=true"); | 43 | cmd.arg("uploadpack.allowTipSHA1InWant=true"); |
| 44 | cmd.arg("-c"); | ||
| 45 | cmd.arg("uploadpack.allowFilter=true"); | ||
| 43 | 46 | ||
| 44 | cmd.arg(service.command_name()); | 47 | cmd.arg(service.command_name()); |
| 45 | 48 | ||