diff options
author | Junio C Hamano <gitster@pobox.com> | 2022-05-21 01:26:57 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-05-21 01:26:57 +0300 |
commit | ed54e1b31ad1a9a35ef6c23024d325a2c4d85221 (patch) | |
tree | 1ff81c3b02ad0d08b69c21773143d5bc770ba73e /t | |
parent | 1dff6dc016a3b20e92910004ade1c13339b6fe7f (diff) | |
parent | 58194173652786709ba9dd1f56df6922a92f419f (diff) |
Merge branch 'gc/pull-recurse-submodules'
"git pull" without "--recurse-submodules=<arg>" made
submodule.recurse take precedence over fetch.recurseSubmodules by
mistake, which has been corrected.
* gc/pull-recurse-submodules:
pull: do not let submodule.recurse override fetch.recurseSubmodules
Diffstat (limited to 't')
-rwxr-xr-x | t/t5572-pull-submodule.sh | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/t/t5572-pull-submodule.sh b/t/t5572-pull-submodule.sh index fa6b4cca65..a35396fadf 100755 --- a/t/t5572-pull-submodule.sh +++ b/t/t5572-pull-submodule.sh @@ -107,6 +107,32 @@ test_expect_success " --[no-]recurse-submodule and submodule.recurse" ' test_path_is_file super/sub/merge_strategy_4.t ' +test_expect_success "fetch.recurseSubmodules option triggers recursive fetch (but not recursive update)" ' + test_commit -C child merge_strategy_5 && + # Omit the parent commit, otherwise this passes with the + # default "pull" behavior. + + git -C super -c fetch.recursesubmodules=true pull --no-rebase && + # Check that the submodule commit was fetched + sub_oid=$(git -C child rev-parse HEAD) && + git -C super/sub cat-file -e $sub_oid && + # Check that the submodule worktree did not update + ! test_path_is_file super/sub/merge_strategy_5.t +' + +test_expect_success "fetch.recurseSubmodules takes precedence over submodule.recurse" ' + test_commit -C child merge_strategy_6 && + # Omit the parent commit, otherwise this passes with the + # default "pull" behavior. + + git -C super -c submodule.recurse=false -c fetch.recursesubmodules=true pull --no-rebase && + # Check that the submodule commit was fetched + sub_oid=$(git -C child rev-parse HEAD) && + git -C super/sub cat-file -e $sub_oid && + # Check that the submodule worktree did not update + ! test_path_is_file super/sub/merge_strategy_6.t +' + test_expect_success 'pull --rebase --recurse-submodules (remote superproject submodule changes, local submodule changes)' ' # This tests the following scenario : # - local submodule has new commits |