From: Jeff Hostetler Date: Thu, 13 Jul 2017 17:34:50 GMT Subject: [PATCH v2 10/19] t6112: rev-list object filtering test Message-ID: <20170713173459.3559-11-git@jeffhostetler.com> In-Reply-To: <20170713173459.3559-1-git@jeffhostetler.com> From: Jeff Hostetler Signed-off-by: Jeff Hostetler --- t/t6112-rev-list-filters-objects.sh | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 t/t6112-rev-list-filters-objects.sh diff --git a/t/t6112-rev-list-filters-objects.sh b/t/t6112-rev-list-filters-objects.sh new file mode 100644 index 0000000..ded2b04 --- /dev/null +++ b/t/t6112-rev-list-filters-objects.sh @@ -0,0 +1,37 @@ +#!/bin/sh + +test_description='git rev-list with object filtering' + +. ./test-lib.sh + +test_expect_success 'setup' ' + for n in 1 2 3 4 5 ; do \ + echo $n > file.$n ; \ + git add file.$n ; \ + git commit -m "$n" ; \ + done +' + +test_expect_success 'omit-all-blobs omitted 5 blobs' ' + git rev-list HEAD --objects --filter-print-manifest --filter-omit-all-blobs >omit_all && + grep "^~" omit_all >omitted && + test $(cat omitted | wc -l) = 5 +' + +test_expect_success 'omit-all-blobs blob sha match' ' + git rev-list HEAD --objects >normal && + awk "/file/ {print \$1;}" normal_sha && + sed "s/~//" omit_all_sha && + test_cmp normal_sha omit_all_sha +' + +test_expect_success 'omit-all-blobs nothing else changed' ' + grep -v "file" normal_other && + grep -v "~" omit_other && + test_cmp normal_other omit_other +' + +# TODO test filter-omit-large-blobs +# TODO test filter-use-sparse + +test_done -- 2.9.3