new file mode 100755
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+test_description='partial clone with submodules'
+
+. ./test-lib.sh
+
+test_expect_success 'partial clone setup' '
+ test_create_repo super &&
+ test_create_repo submod &&
+
+ git -C super config uploadpack.allowfilter true &&
+ git -C super config uploadpack.allowanysha1inwant true &&
+
+ generate_zero_bytes 1024 >submod/bigfile &&
+ generate_zero_bytes 1 >submod/smallfile &&
+ git -C submod add bigfile smallfile &&
+ git -C submod commit -m "Adding files" &&
+ git -C super submodule add ../submod ./submod &&
+ git -C super commit -m "Adding submodule" &&
+ generate_zero_bytes 1025 >submod/bigfile &&
+ git -C submod commit -m "Extend bigfile" bigfile &&
+ git -C super submodule update --rebase --remote &&
+ git -C super add submod &&
+ git -C super commit -m "Extend bigfile"
+'
+
+test_expect_success 'partial clone of super' '
+ git clone --recursive --filter=blob:limit=512 "file://$(pwd)/super" cloned-super &&
+ test_path_exists cloned-super/submod/bigfile
+'
+
+test_expect_success 'update submodule' '
+ generate_zero_bytes 1026 >submod/bigfile &&
+ git -C submod commit -m "Further extend bigfile" bigfile &&
+ git -C super submodule update --rebase --remote &&
+ git -C super add submod &&
+ git -C super commit -m "Further extend bigfile"
+'
+
+test_expect_success 'update partial clone' '
+ git -C cloned-super pull --recurse-submodules --rebase
+'
+
+test_done