From: Junio C Hamano <gitster@pobox.com>
To: Sergey Vlasov <vsu@altlinux.ru>
Cc: git@vger.kernel.org, Martin Koegler <mkoegler@auto.tuwien.ac.at>
Subject: [PATCH] t5300: add test for "unpack-objects --strict"
Date: Wed, 05 Mar 2008 00:47:04 -0800 [thread overview]
Message-ID: <7v4pblpng7.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: 7vfxv65kkl.fsf@gitster.siamese.dyndns.org
This adds a test for unpacking deltified objects with --strict option.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
Junio C Hamano <gitster@pobox.com> writes:
> Sergey Vlasov <vsu@altlinux.ru> writes:
> ...
>> However, I do not have time to create a proper test case for this.
>
> That's Ok. What we need is a fix but it is not that urgent as the stuff
> is now reverted for now.
t/t5300-pack-object.sh | 36 ++++++++++++++++++++++++++++++++++++
1 files changed, 36 insertions(+), 0 deletions(-)
diff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh
index cd3c149..0cf0ff7 100755
--- a/t/t5300-pack-object.sh
+++ b/t/t5300-pack-object.sh
@@ -274,4 +274,40 @@ test_expect_success \
packname_4=$(git pack-objects test-4 <obj-list) &&
test 3 = $(ls test-4-*.pack | wc -l)'
+test_expect_failure 'unpacking with --strict' '
+
+ git config --unset pack.packsizelimit &&
+ COPYING=$(git hash-object -w ../../COPYING) &&
+ for j in a b c d e f g
+ do
+ for i in 0 1 2 3 4 5 6 7 8 9
+ do
+ o=$(echo $j$i | git hash-object -w --stdin) &&
+ echo "100644 $o 0 $j$i"
+ done
+ done >LIST &&
+ rm -f .git/index &&
+ git update-index --index-info <LIST &&
+ LIST=$(git write-tree) &&
+ rm -f .git/index &&
+ head -n 10 LIST | git update-index --index-info &&
+ LI=$(git write-tree) &&
+ rm -f .git/index &&
+ tail -n 10 LIST | git update-index --index-info &&
+ ST=$(git write-tree) &&
+ PACK=$( (
+ echo "$LIST"
+ echo "$LI"
+ echo "$ST"
+ ) | git pack-objects test-5 ) &&
+
+ test_create_repo another &&
+
+ (
+ cd another &&
+ git unpack-objects --strict <../test-5-$PACK.pack
+ )
+
+'
+
test_done
--
1.5.4.3.529.gb25fb
next prev parent reply other threads:[~2008-03-05 8:48 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-04 11:21 [PATCH] fsck.c: fix bogus "empty tree" check Junio C Hamano
2008-03-04 12:26 ` Sergey Vlasov
2008-03-04 19:57 ` Junio C Hamano
2008-03-05 8:47 ` Junio C Hamano [this message]
2008-03-05 9:17 ` [PATCH v2] t5300: add test for "unpack-objects --strict" Junio C Hamano
2008-03-04 21:48 ` [PATCH] fsck.c: fix bogus "empty tree" check Martin Koegler
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7v4pblpng7.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=mkoegler@auto.tuwien.ac.at \
--cc=vsu@altlinux.ru \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).