Skip to content

Commit 419221c

Browse files
pcloudsgitster
authored andcommitted
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>
1 parent 2e2d404 commit 419221c

3 files changed

Lines changed: 2 additions & 48 deletions

File tree

Documentation/technical/api-ref-iteration.txt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,8 @@ Iteration functions
3232

3333
* `for_each_glob_ref_in()` the previous and `for_each_ref_in()` combined.
3434

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()`.
4037

4138
* `for_each_rawref()` can be used to learn about broken ref and symref.
4239

refs.c

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -336,12 +336,6 @@ int for_each_tag_ref(each_ref_fn fn, void *cb_data)
336336
return refs_for_each_tag_ref(get_main_ref_store(), fn, cb_data);
337337
}
338338

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-
345339
int refs_for_each_branch_ref(struct ref_store *refs, each_ref_fn fn, void *cb_data)
346340
{
347341
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)
352346
return refs_for_each_branch_ref(get_main_ref_store(), fn, cb_data);
353347
}
354348

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-
361349
int refs_for_each_remote_ref(struct ref_store *refs, each_ref_fn fn, void *cb_data)
362350
{
363351
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)
12541242
return 0;
12551243
}
12561244

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-
12661245
int head_ref(each_ref_fn fn, void *cb_data)
12671246
{
12681247
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)
13231302
return refs_for_each_ref(get_main_ref_store(), fn, cb_data);
13241303
}
13251304

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-
13311305
int refs_for_each_ref_in(struct ref_store *refs, const char *prefix,
13321306
each_ref_fn fn, void *cb_data)
13331307
{
@@ -1349,13 +1323,6 @@ int for_each_fullref_in(const char *prefix, each_ref_fn fn, void *cb_data, unsig
13491323
prefix, fn, 0, flag, cb_data);
13501324
}
13511325

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-
13591326
int refs_for_each_fullref_in(struct ref_store *refs, const char *prefix,
13601327
each_ref_fn fn, void *cb_data,
13611328
unsigned int broken)

refs.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -304,16 +304,6 @@ int for_each_glob_ref(each_ref_fn fn, const char *pattern, void *cb_data);
304304
int for_each_glob_ref_in(each_ref_fn fn, const char *pattern,
305305
const char *prefix, void *cb_data);
306306

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-
317307
int head_ref_namespaced(each_ref_fn fn, void *cb_data);
318308
int for_each_namespaced_ref(each_ref_fn fn, void *cb_data);
319309

0 commit comments

Comments
 (0)