From: Jeff Hostetler <git@jeffhostetler.com>
To: git@vger.kernel.org
Cc: gitster@pobox.com, peff@peff.net, jonathantanmy@google.com,
jrnieder@gmail.com, Jeff Hostetler <jeffhost@microsoft.com>
Subject: [PATCH 3/3] pack-objects: add t5317 to test max-blob-size
Date: Thu, 22 Jun 2017 20:36:15 +0000 [thread overview]
Message-ID: <20170622203615.34135-4-git@jeffhostetler.com> (raw)
In-Reply-To: <20170622203615.34135-1-git@jeffhostetler.com>
From: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
---
t/t5317-pack-objects-blob-filtering.sh | 68 ++++++++++++++++++++++++++++++++++
1 file changed, 68 insertions(+)
create mode 100644 t/t5317-pack-objects-blob-filtering.sh
diff --git a/t/t5317-pack-objects-blob-filtering.sh b/t/t5317-pack-objects-blob-filtering.sh
new file mode 100644
index 0000000..58124ab
--- /dev/null
+++ b/t/t5317-pack-objects-blob-filtering.sh
@@ -0,0 +1,68 @@
+#!/bin/sh
+
+test_description='pack-objects blob filtering'
+
+. ./test-lib.sh
+
+test_expect_success setup '
+ printf "%10s" X >x10.txt &&
+ printf "%100s" X >x100.txt &&
+ printf "%1000s" X >x1000.txt &&
+ git add *.txt &&
+ git commit -m txt
+'
+
+test_expect_success 'all blobs' '
+ test_when_finished "rm -f *.pack *.idx" &&
+ git pack-objects --revs --thin --stdout >z.pack <<-EOF &&
+ master
+
+ EOF
+ git index-pack z.pack &&
+ test 3 = $(git verify-pack -v z.pack | grep blob | wc -l)
+'
+
+test_expect_success 'no blobs (max equals 0)' '
+ test_when_finished "rm -f *.pack *.idx" &&
+ git pack-objects --revs --thin --stdout --max-blob-size=0 >z.pack <<-EOF &&
+ master
+
+ EOF
+ git index-pack z.pack &&
+ test 0 = $(git verify-pack -v z.pack | grep blob | wc -l)
+'
+
+test_expect_success 'small 20 blobs' '
+ test_when_finished "rm -f *.pack *.idx" &&
+ git pack-objects --revs --thin --stdout --max-blob-size=20 >z.pack <<-EOF &&
+ master
+
+ EOF
+ git index-pack z.pack &&
+ test 1 = $(git verify-pack -v z.pack | grep blob | wc -l)
+'
+
+test_expect_success 'small 200 blobs' '
+ test_when_finished "rm -f *.pack *.idx" &&
+ git pack-objects --revs --thin --stdout --max-blob-size=200 >z.pack <<-EOF &&
+ master
+
+ EOF
+ git index-pack z.pack &&
+ test 2 = $(git verify-pack -v z.pack | grep blob | wc -l)
+'
+
+test_expect_success 'special files always present' '
+ test_when_finished "rm -f *.pack *.idx" &&
+ cp x1000.txt .gitignore &&
+ git add .gitignore &&
+ git commit -m "add ignores" &&
+ git pack-objects --revs --stdout --max-blob-size=0 >z.pack <<-EOF &&
+ master
+
+ EOF
+ git index-pack z.pack &&
+ test 1 = $(git verify-pack -v z.pack | grep blob | wc -l)
+'
+
+test_done
--
2.9.3
prev parent reply other threads:[~2017-06-22 20:36 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-22 20:36 [PATCH 0/3] WIP list-objects and pack-objects for partial clone Jeff Hostetler
2017-06-22 20:36 ` [PATCH 1/3] list-objects: add filter_blob to traverse_commit_list Jeff Hostetler
2017-06-22 21:45 ` Jonathan Tan
2017-06-22 22:10 ` Jonathan Tan
2017-06-23 17:16 ` Jeff Hostetler
2017-06-28 16:23 ` Junio C Hamano
2017-06-28 17:13 ` Jeff Hostetler
2017-06-28 17:54 ` Junio C Hamano
2017-06-22 20:36 ` [PATCH 2/3] pack-objects: WIP add max-blob-size filtering Jeff Hostetler
2017-06-22 21:54 ` Jonathan Tan
2017-06-22 22:14 ` Junio C Hamano
2017-06-22 20:36 ` Jeff Hostetler [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170622203615.34135-4-git@jeffhostetler.com \
--to=git@jeffhostetler.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jeffhost@microsoft.com \
--cc=jonathantanmy@google.com \
--cc=jrnieder@gmail.com \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).