[PATCH] (squash) add index-pack with git-dir test
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 21, 2008, 05:03 UTC
- Message-ID
- <7vzlkyzgiw.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <alpine.LFD.2.00.0810202110380.26244@xanadu.home>
This tries to make sure that the recent fix to d0b92a3 (index-pack: setup git repository, 2008-08-26) does not introduce regression, and protects the fix from getting broken again.
Signed-off-by: Junio C Hamano <gitster@pobox.com> ---
* And unfortunately the first one fails with the fix and succeeds without; the second one succeeds with your fix and fails without.
t/t5302-pack-index.sh | 20 ++++++++++++++++++++ 1 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/t/t5302-pack-index.sh b/t/t5302-pack-index.sh index 6424db1..2edab73 100755 --- a/t/t5302-pack-index.sh +++ b/t/t5302-pack-index.sh @@ -177,4 +177,24 @@ test_expect_success \ ".git/objects/pack/pack-${pack1}.pack" 2>&1) && echo "$err" | grep "CRC mismatch"' +test_expect_success 'running index-pack from a subdirectory' ' + mkdir subdir && + cp test-1-${pack1}.pack subdir/. && + ( + cd subdir && + git index-pack test-1-${pack1}.pack + ) && + test -f subdir/test-1-${pack1}.idx +' + +test_expect_success 'running index-pack in the object store' ' + rm -f .git/objects/pack/* && + cp test-1-${pack1}.pack .git/objects/pack/pack-${pack1}.pack && + ( + cd .git/objects/pack + git index-pack pack-${pack1}.pack + ) && + test -f .git/objects/pack/pack-${pack1}.idx +' + test_done
-- 1.6.0.2.588.g31023