]> git.ipfire.org Git - thirdparty/git.git/commitdiff
submodule update: add tests for --filter
authorGlen Choo <chooglen@google.com>
Sat, 5 Mar 2022 00:14:00 +0000 (16:14 -0800)
committerJunio C Hamano <gitster@pobox.com>
Sat, 5 Mar 2022 00:39:12 +0000 (16:39 -0800)
Test the "--filter" option to make sure we don't break anything while
refactoring "git submodule update".

Signed-off-by: Glen Choo <chooglen@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t7406-submodule-update.sh

index 7764c1c3cb6e601abd4678e2482f9b7787245938..000e055811c67f2d7cfe89b50ce8fa0aee1af61d 100755 (executable)
@@ -1071,4 +1071,16 @@ test_expect_success 'submodule update --quiet passes quietness to fetch with a s
        )
 '
 
+test_expect_success 'submodule update --filter requires --init' '
+       test_expect_code 129 git -C super submodule update --filter blob:none
+'
+
+test_expect_success 'submodule update --filter sets partial clone settings' '
+       test_when_finished "rm -rf super-filter" &&
+       git clone cloned super-filter &&
+       git -C super-filter submodule update --init --filter blob:none &&
+       test_cmp_config -C super-filter/submodule true remote.origin.promisor &&
+       test_cmp_config -C super-filter/submodule blob:none remote.origin.partialclonefilter
+'
+
 test_done