summaryrefslogtreecommitdiff
path: root/t/t5526-fetch-submodules.sh
diff options
context:
space:
mode:
authorJens Lehmann <Jens.Lehmann@web.de>2011-03-06 22:11:48 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-03-09 21:10:35 (GMT)
commit1fb2550202d6f88d90121624c1fac0b81ff8c33f (patch)
tree8c0ec680547c297a8cc9bf9a6f8313c89d3d0eec /t/t5526-fetch-submodules.sh
parent8f0700dd33f63e594b9b34c84efe94e670ea4f45 (diff)
downloadgit-1fb2550202d6f88d90121624c1fac0b81ff8c33f.zip
git-1fb2550202d6f88d90121624c1fac0b81ff8c33f.tar.gz
git-1fb2550202d6f88d90121624c1fac0b81ff8c33f.tar.bz2
config: teach the fetch.recurseSubmodules option the 'on-demand' value
To enable the user to change the default behavior of "git fetch" and "git pull" regarding submodule recursion add the new "on-demand" value which has just been added to the "--recurse-submodules" command line option. Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5526-fetch-submodules.sh')
-rwxr-xr-xt/t5526-fetch-submodules.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/t/t5526-fetch-submodules.sh b/t/t5526-fetch-submodules.sh
index 4cd723c..e6d873a 100755
--- a/t/t5526-fetch-submodules.sh
+++ b/t/t5526-fetch-submodules.sh
@@ -372,4 +372,32 @@ test_expect_success "'--recurse-submodules=on-demand' stops when no new submodul
test_cmp expect.err.file actual.err
'
+test_expect_success "'fetch.recurseSubmodules=on-demand' overrides global config" '
+ (
+ cd downstream &&
+ git fetch --recurse-submodules
+ ) &&
+ add_upstream_commit &&
+ git config --global 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 fetch.recurseSubmodules on-demand &&
+ git fetch >../actual.out 2>../actual.err
+ ) &&
+ git config --global --unset fetch.recurseSubmodules &&
+ (
+ cd downstream &&
+ git config --unset fetch.recurseSubmodules
+ ) &&
+ test_cmp expect.out.sub actual.out &&
+ test_cmp expect.err.2 actual.err
+'
+
test_done