aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackTest.java
diff options
context:
space:
mode:
authorJonathan Nieder <jrn@google.com>2020-07-29 19:18:51 -0700
committerJonathan Nieder <jrn@google.com>2020-07-29 21:04:20 -0700
commit3c807e01580680106b7db0b1aab60e3b5d010ea4 (patch)
tree83e73be457e2ce722d73e4211b61942ee45ae89e /org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackTest.java
parentdceedbcd6e66d60f095aacfa308055b7ca6f45a7 (diff)
downloadjgit-3c807e01580680106b7db0b1aab60e3b5d010ea4.tar.gz
jgit-3c807e01580680106b7db0b1aab60e3b5d010ea4.zip
Do not send empty blob in response to blob:none filter
If I create a repository containing an empty file and clone it with git clone --no-checkout --filter=blob:none \ https://url/of/repository then I would expect no blobs to be transferred over the wire. Alas, JGit rewrites filter=blob:none to filter=blob:limit=0, so if the repository contains an empty file then the empty blob gets transferred. Fix it by teaching JGit about filters based on object type to complement the existing filters based on object size. This prepares us for other future filters such as object:none. In particular, this means we do not need to look up the size of the filtered blobs, which should speed up clones. Noticed by Anna Pologova and Terry Parker. Change-Id: Id4b234921a190c108d8be2c87f54dcbfa811602a Signed-off-by: Jonathan Nieder <jrn@google.com>
Diffstat (limited to 'org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackTest.java')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackTest.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackTest.java
index bb33eefcee..e9b4af932e 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackTest.java
@@ -127,7 +127,7 @@ public class UploadPackTest {
}
@Test
- public void testFetchWithBlobNoneFilter() throws Exception {
+ public void testFetchWithBlobZeroFilter() throws Exception {
InMemoryRepository server2 = newRepo("server2");
try (TestRepository<InMemoryRepository> remote2 = new TestRepository<>(
server2)) {