refs: remove dead for_each_*_submodule()

These are used in revision.c. After the last patch they are replaced with the refs_ version. Delete them. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Nguyễn Thái Ngọc Duy committed Aug 23, 2017 at 19:36 UTC 419221c1065981311b1a0f4a469d4d8a9ea09f54
3 files changed +2 -48
Documentation/technical/api-ref-iteration.txt
+2 -5
@@ -32,11 +32,8 @@ Iteration functions
32
33 * `for_each_glob_ref_in()` the previous and `for_each_ref_in()` combined.
34
35 -* `head_ref_submodule()`, `for_each_ref_submodule()`,
36 - `for_each_ref_in_submodule()`, `for_each_tag_ref_submodule()`,
37 - `for_each_branch_ref_submodule()`, `for_each_remote_ref_submodule()`
38 - do the same as the functions described above but for a specified
39 - submodule.
35 +* Use `refs_` API for accessing submodules. The submodule ref store could
36 + be obtained with `get_submodule_ref_store()`.
37
38 * `for_each_rawref()` can be used to learn about broken ref and symref.
39
refs.c
-33
@@ -336,12 +336,6 @@ int for_each_tag_ref(each_ref_fn fn, void *cb_data)
336 return refs_for_each_tag_ref(get_main_ref_store(), fn, cb_data);
337 }
338
339 -int for_each_tag_ref_submodule(const char *submodule, each_ref_fn fn, void *cb_data)
340 -{
341 - return refs_for_each_tag_ref(get_submodule_ref_store(submodule),
342 - fn, cb_data);
343 -}
344 -
339 int refs_for_each_branch_ref(struct ref_store *refs, each_ref_fn fn, void *cb_data)
340 {
341 return refs_for_each_ref_in(refs, "refs/heads/", fn, cb_data);
@@ -352,12 +346,6 @@ int for_each_branch_ref(each_ref_fn fn, void *cb_data)
346 return refs_for_each_branch_ref(get_main_ref_store(), fn, cb_data);
347 }
348
355 -int for_each_branch_ref_submodule(const char *submodule, each_ref_fn fn, void *cb_data)
356 -{
357 - return refs_for_each_branch_ref(get_submodule_ref_store(submodule),
358 - fn, cb_data);
359 -}
360 -
349 int refs_for_each_remote_ref(struct ref_store *refs, each_ref_fn fn, void *cb_data)
350 {
351 return refs_for_each_ref_in(refs, "refs/remotes/", fn, cb_data);
@@ -1254,15 +1242,6 @@ int refs_head_ref(struct ref_store *refs, each_ref_fn fn, void *cb_data)
1242 return 0;
1243 }
1244
1257 -int head_ref_submodule(const char *submodule, each_ref_fn fn, void *cb_data)
1258 -{
1259 - struct ref_store *refs = get_submodule_ref_store(submodule);
1260 -
1261 - if (!refs)
1262 - return -1;
1263 - return refs_head_ref(refs, fn, cb_data);
1264 -}
1265 -
1245 int head_ref(each_ref_fn fn, void *cb_data)
1246 {
1247 return refs_head_ref(get_main_ref_store(), fn, cb_data);
@@ -1323,11 +1302,6 @@ int for_each_ref(each_ref_fn fn, void *cb_data)
1302 return refs_for_each_ref(get_main_ref_store(), fn, cb_data);
1303 }
1304
1326 -int for_each_ref_submodule(const char *submodule, each_ref_fn fn, void *cb_data)
1327 -{
1328 - return refs_for_each_ref(get_submodule_ref_store(submodule), fn, cb_data);
1329 -}
1330 -
1305 int refs_for_each_ref_in(struct ref_store *refs, const char *prefix,
1306 each_ref_fn fn, void *cb_data)
1307 {
@@ -1349,13 +1323,6 @@ int for_each_fullref_in(const char *prefix, each_ref_fn fn, void *cb_data, unsig
1323 prefix, fn, 0, flag, cb_data);
1324 }
1325
1352 -int for_each_ref_in_submodule(const char *submodule, const char *prefix,
1353 - each_ref_fn fn, void *cb_data)
1354 -{
1355 - return refs_for_each_ref_in(get_submodule_ref_store(submodule),
1356 - prefix, fn, cb_data);
1357 -}
1358 -
1326 int refs_for_each_fullref_in(struct ref_store *refs, const char *prefix,
1327 each_ref_fn fn, void *cb_data,
1328 unsigned int broken)
refs.h
-10
@@ -304,16 +304,6 @@ int for_each_glob_ref(each_ref_fn fn, const char *pattern, void *cb_data);
304 int for_each_glob_ref_in(each_ref_fn fn, const char *pattern,
305 const char *prefix, void *cb_data);
306
307 -int head_ref_submodule(const char *submodule, each_ref_fn fn, void *cb_data);
308 -int for_each_ref_submodule(const char *submodule,
309 - each_ref_fn fn, void *cb_data);
310 -int for_each_ref_in_submodule(const char *submodule, const char *prefix,
311 - each_ref_fn fn, void *cb_data);
312 -int for_each_tag_ref_submodule(const char *submodule,
313 - each_ref_fn fn, void *cb_data);
314 -int for_each_branch_ref_submodule(const char *submodule,
315 - each_ref_fn fn, void *cb_data);
316 -
307 int head_ref_namespaced(each_ref_fn fn, void *cb_data);
308 int for_each_namespaced_ref(each_ref_fn fn, void *cb_data);
309