From bf42b384058ee2b34f587426d0788353ffa9012a Mon Sep 17 00:00:00 2001 From: Jens Lehmann Date: Sun, 6 Mar 2011 23:12:19 +0100 Subject: Submodules: Add 'on-demand' value for the 'fetchRecurseSubmodule' option Now the behavior of fetch and pull can be configured to the recently added 'on-demand' mode separately for each submodule too. Signed-off-by: Jens Lehmann Signed-off-by: Junio C Hamano --- t/t5526-fetch-submodules.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 't') diff --git a/t/t5526-fetch-submodules.sh b/t/t5526-fetch-submodules.sh index e6d873a489..09701aa1a7 100755 --- a/t/t5526-fetch-submodules.sh +++ b/t/t5526-fetch-submodules.sh @@ -400,4 +400,32 @@ test_expect_success "'fetch.recurseSubmodules=on-demand' overrides global config test_cmp expect.err.2 actual.err ' +test_expect_success "'submodule..fetchRecurseSubmodules=on-demand' overrides fetch.recurseSubmodules" ' + ( + cd downstream && + git fetch --recurse-submodules + ) && + add_upstream_commit && + git config fetch.recurseSubmodules false && + head1=$(git rev-parse --short HEAD) && + git add submodule && + git commit -m "new submodule" && + head2=$(git rev-parse --short HEAD) && + echo "From $pwd/." > expect.err.2 && + echo " $head1..$head2 master -> origin/master" >> expect.err.2 + head -2 expect.err >> expect.err.2 && + ( + cd downstream && + git config submodule.submodule.fetchRecurseSubmodules on-demand && + git fetch >../actual.out 2>../actual.err + ) && + git config --unset fetch.recurseSubmodules && + ( + cd downstream && + git config --unset submodule.submodule.fetchRecurseSubmodules + ) && + test_cmp expect.out.sub actual.out && + test_cmp expect.err.2 actual.err +' + test_done -- cgit v1.2.3