diff --git a/contrib/sparse-checkout/setup-sparse-checkout.sh b/contrib/sparse-checkout/setup-sparse-checkout.sh index c728a03e35e..2f8b843b1bf 100755 --- a/contrib/sparse-checkout/setup-sparse-checkout.sh +++ b/contrib/sparse-checkout/setup-sparse-checkout.sh @@ -14,5 +14,6 @@ git config submodule."contrib/icu".update '!../sparse-checkout/update-icu.sh' git config submodule."contrib/boost".update '!../sparse-checkout/update-boost.sh' git config submodule."contrib/aws-s2n-tls".update '!../sparse-checkout/update-aws-s2n-tls.sh' git config submodule."contrib/protobuf".update '!../sparse-checkout/update-protobuf.sh' +git config submodule."contrib/postgres".update '!../sparse-checkout/update-postgres.sh' git config submodule."contrib/libxml2".update '!../sparse-checkout/update-libxml2.sh' git config submodule."contrib/brotli".update '!../sparse-checkout/update-brotli.sh' diff --git a/contrib/sparse-checkout/update-postgres.sh b/contrib/sparse-checkout/update-postgres.sh new file mode 100755 index 00000000000..d54d29c27c3 --- /dev/null +++ b/contrib/sparse-checkout/update-postgres.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +echo "Using sparse checkout for postgres" + +FILES_TO_CHECKOUT=$(git rev-parse --git-dir)/info/sparse-checkout +echo '!/*' > $FILES_TO_CHECKOUT +echo '/src/interfaces/libpq/*' >> $FILES_TO_CHECKOUT +echo '!/src/interfaces/libpq/*/*' >> $FILES_TO_CHECKOUT +echo '/src/common/*' >> $FILES_TO_CHECKOUT +echo '!/src/port/*/*' >> $FILES_TO_CHECKOUT +echo '/src/port/*' >> $FILES_TO_CHECKOUT +echo '/src/include/*' >> $FILES_TO_CHECKOUT + +git config core.sparsecheckout true +git checkout $1 +git read-tree -mu HEAD