diff options
author | Jonathan Nieder <jrn@google.com> | 2020-07-29 19:18:51 -0700 |
---|---|---|
committer | Jonathan Nieder <jrn@google.com> | 2020-07-29 21:04:20 -0700 |
commit | 3c807e01580680106b7db0b1aab60e3b5d010ea4 (patch) | |
tree | 83e73be457e2ce722d73e4211b61942ee45ae89e /org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackTest.java | |
parent | dceedbcd6e66d60f095aacfa308055b7ca6f45a7 (diff) | |
download | jgit-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.java | 2 |
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)) { |