Skip to content

Commit 32bc548

Browse files
bmwillgitster
authored andcommitted
submodule-config: remove support for overlaying repository config
All callers have been migrated to explicitly read any configuration they need. The support for handling it automatically in submodule-config is no longer needed. Signed-off-by: Brandon Williams <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 078b75e commit 32bc548

File tree

3 files changed

+0
-79
lines changed

3 files changed

+0
-79
lines changed

submodule-config.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ extern int option_fetch_parse_recurse_submodules(const struct option *opt,
3434
const char *arg, int unset);
3535
extern int parse_update_recurse_submodules_arg(const char *opt, const char *arg);
3636
extern int parse_push_recurse_submodules_arg(const char *opt, const char *arg);
37-
extern int parse_submodule_config_option(const char *var, const char *value);
3837
extern int submodule_config_option(struct repository *repo,
3938
const char *var, const char *value);
4039
extern const struct submodule *submodule_from_name(

t/helper/test-submodule-config.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@ static void die_usage(int argc, const char **argv, const char *msg)
1010
exit(1);
1111
}
1212

13-
static int git_test_config(const char *var, const char *value, void *cb)
14-
{
15-
return parse_submodule_config_option(var, value);
16-
}
17-
1813
int cmd_main(int argc, const char **argv)
1914
{
2015
const char **arg = argv;
@@ -38,7 +33,6 @@ int cmd_main(int argc, const char **argv)
3833

3934
setup_git_directory();
4035
gitmodules_config();
41-
git_config(git_test_config, NULL);
4236

4337
while (*arg) {
4438
struct object_id commit_oid;

t/t7411-submodule-config.sh

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -122,78 +122,6 @@ test_expect_success 'using different treeishs works' '
122122
)
123123
'
124124

125-
cat >super/expect_url <<EOF
126-
Submodule url: '[email protected]:a.git' for path 'b'
127-
Submodule url: '[email protected]:submodule.git' for path 'submodule'
128-
EOF
129-
130-
cat >super/expect_local_path <<EOF
131-
Submodule name: 'a' for path 'c'
132-
Submodule name: 'submodule' for path 'submodule'
133-
EOF
134-
135-
test_expect_success 'reading of local configuration' '
136-
(cd super &&
137-
old_a=$(git config submodule.a.url) &&
138-
old_submodule=$(git config submodule.submodule.url) &&
139-
git config submodule.a.url [email protected]:a.git &&
140-
git config submodule.submodule.url [email protected]:submodule.git &&
141-
test-submodule-config --url \
142-
"" b \
143-
"" submodule \
144-
>actual &&
145-
test_cmp expect_url actual &&
146-
git config submodule.a.path c &&
147-
test-submodule-config \
148-
"" c \
149-
"" submodule \
150-
>actual &&
151-
test_cmp expect_local_path actual &&
152-
git config submodule.a.url "$old_a" &&
153-
git config submodule.submodule.url "$old_submodule" &&
154-
git config --unset submodule.a.path c
155-
)
156-
'
157-
158-
cat >super/expect_url <<EOF
159-
Submodule url: '../submodule' for path 'b'
160-
Submodule url: '[email protected]:submodule.git' for path 'submodule'
161-
EOF
162-
163-
test_expect_success 'reading of local configuration for uninitialized submodules' '
164-
(
165-
cd super &&
166-
git submodule deinit -f b &&
167-
old_submodule=$(git config submodule.submodule.url) &&
168-
git config submodule.submodule.url [email protected]:submodule.git &&
169-
test-submodule-config --url \
170-
"" b \
171-
"" submodule \
172-
>actual &&
173-
test_cmp expect_url actual &&
174-
git config submodule.submodule.url "$old_submodule" &&
175-
git submodule init b
176-
)
177-
'
178-
179-
cat >super/expect_fetchrecurse_die.err <<EOF
180-
fatal: bad submodule.submodule.fetchrecursesubmodules argument: blabla
181-
EOF
182-
183-
test_expect_success 'local error in fetchrecursesubmodule dies early' '
184-
(cd super &&
185-
git config submodule.submodule.fetchrecursesubmodules blabla &&
186-
test_must_fail test-submodule-config \
187-
"" b \
188-
"" submodule \
189-
>actual.out 2>actual.err &&
190-
touch expect_fetchrecurse_die.out &&
191-
test_cmp expect_fetchrecurse_die.out actual.out &&
192-
test_cmp expect_fetchrecurse_die.err actual.err &&
193-
git config --unset submodule.submodule.fetchrecursesubmodules
194-
)
195-
'
196-
197125
test_expect_success 'error in history in fetchrecursesubmodule lets continue' '
198126
(cd super &&
199127
git config -f .gitmodules \

0 commit comments

Comments
 (0)