diff options
author | Heiko Voigt <hvoigt@hvoigt.net> | 2015-08-17 17:21:59 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-08-19 11:43:10 -0700 |
commit | 851e18c3859ad0f9f7e91fdb4d6cce5a8272420b (patch) | |
tree | 174141bad5af8da81d0eb6272584eadfa1906c74 /t | |
parent | 0d9f282c943a0799999176a2d8291ecbad060389 (diff) | |
download | git-851e18c3859ad0f9f7e91fdb4d6cce5a8272420b.tar.gz |
submodule: use new config API for worktree configurations
We remove the extracted functions and directly parse into and read out
of the cache. This allows us to have one unified way of accessing
submodule configuration values specific to single submodules. Regardless
whether we need to access a configuration from history or from the
worktree.
Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-x | t/t7411-submodule-config.sh | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/t/t7411-submodule-config.sh b/t/t7411-submodule-config.sh index 2602bc515b..7229978cd2 100755 --- a/t/t7411-submodule-config.sh +++ b/t/t7411-submodule-config.sh @@ -5,8 +5,8 @@ test_description='Test submodules config cache infrastructure -This test verifies that parsing .gitmodules configuration directly -from the database works. +This test verifies that parsing .gitmodules configurations directly +from the database and from the worktree works. ' TEST_NO_CREATE_REPO=1 @@ -82,4 +82,37 @@ test_expect_success 'error in one submodule config lets continue' ' ) ' +cat >super/expect_url <<EOF +Submodule url: 'git@somewhere.else.net:a.git' for path 'b' +Submodule url: 'git@somewhere.else.net:submodule.git' for path 'submodule' +EOF + +cat >super/expect_local_path <<EOF +Submodule name: 'a' for path 'c' +Submodule name: 'submodule' for path 'submodule' +EOF + +test_expect_success 'reading of local configuration' ' + (cd super && + old_a=$(git config submodule.a.url) && + old_submodule=$(git config submodule.submodule.url) && + git config submodule.a.url git@somewhere.else.net:a.git && + git config submodule.submodule.url git@somewhere.else.net:submodule.git && + test-submodule-config --url \ + "" b \ + "" submodule \ + >actual && + test_cmp expect_url actual && + git config submodule.a.path c && + test-submodule-config \ + "" c \ + "" submodule \ + >actual && + test_cmp expect_local_path actual && + git config submodule.a.url $old_a && + git config submodule.submodule.url $old_submodule && + git config --unset submodule.a.path c + ) +' + test_done |