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 <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Brandon Williams committed
Aug 3, 2017 at 11:19 UTC
32bc548329d20d33fb25973d76440eccd260c433
3 files changed
-79
submodule-config.h
-1
@@ -34,7 +34,6 @@ extern int option_fetch_parse_recurse_submodules(const struct option *opt,
34
const char *arg, int unset);
35
extern int parse_update_recurse_submodules_arg(const char *opt, const char *arg);
36
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);
37
extern int submodule_config_option(struct repository *repo,
38
const char *var, const char *value);
39
extern const struct submodule *submodule_from_name(
t/helper/test-submodule-config.c
-6
@@ -10,11 +10,6 @@ static void die_usage(int argc, const char **argv, const char *msg)
10
exit(1);
11
}
12
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
-
13
int cmd_main(int argc, const char **argv)
14
{
15
const char **arg = argv;
@@ -38,7 +33,6 @@ int cmd_main(int argc, const char **argv)
33
34
setup_git_directory();
35
gitmodules_config();
41
- git_config(git_test_config, NULL);
36
37
while (*arg) {
38
struct object_id commit_oid;
t/t7411-submodule-config.sh
-72
@@ -122,78 +122,6 @@ test_expect_success 'using different treeishs works' '
122
)
123
'
124
125
-cat >super/expect_url <<EOF
126
-Submodule url: 'git@somewhere.else.net:a.git' for path 'b'
127
-Submodule url: 'git@somewhere.else.net: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 git@somewhere.else.net:a.git &&
140
- git config submodule.submodule.url git@somewhere.else.net: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: 'git@somewhere.else.net: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 git@somewhere.else.net: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
-
125
test_expect_success 'error in history in fetchrecursesubmodule lets continue' '
126
(cd super &&
127
git config -f .gitmodules \