diff options
author | Jens Lehmann <Jens.Lehmann@web.de> | 2011-03-06 23:12:19 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-03-09 13:10:35 -0800 |
commit | bf42b384058ee2b34f587426d0788353ffa9012a (patch) | |
tree | 38f313650b79719502b59759ddce12918ccf058e /t | |
parent | config: teach the fetch.recurseSubmodules option the 'on-demand' value (diff) | |
download | tgif-bf42b384058ee2b34f587426d0788353ffa9012a.tar.xz |
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 <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-x | t/t5526-fetch-submodules.sh | 28 |
1 files changed, 28 insertions, 0 deletions
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.<sub>.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 |