Skip to content

Commit 2e2d404

Browse files
pcloudsgitster
authored andcommitted
refs.c: move for_each_remote_ref_submodule() to submodule.c
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 073cf63 commit 2e2d404

3 files changed

Lines changed: 7 additions & 8 deletions

File tree

refs.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -368,12 +368,6 @@ int for_each_remote_ref(each_ref_fn fn, void *cb_data)
368368
return refs_for_each_remote_ref(get_main_ref_store(), fn, cb_data);
369369
}
370370

371-
int for_each_remote_ref_submodule(const char *submodule, each_ref_fn fn, void *cb_data)
372-
{
373-
return refs_for_each_remote_ref(get_submodule_ref_store(submodule),
374-
fn, cb_data);
375-
}
376-
377371
int head_ref_namespaced(each_ref_fn fn, void *cb_data)
378372
{
379373
struct strbuf buf = STRBUF_INIT;

refs.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,8 +313,6 @@ int for_each_tag_ref_submodule(const char *submodule,
313313
each_ref_fn fn, void *cb_data);
314314
int for_each_branch_ref_submodule(const char *submodule,
315315
each_ref_fn fn, void *cb_data);
316-
int for_each_remote_ref_submodule(const char *submodule,
317-
each_ref_fn fn, void *cb_data);
318316

319317
int head_ref_namespaced(each_ref_fn fn, void *cb_data);
320318
int for_each_namespaced_ref(each_ref_fn fn, void *cb_data);

submodule.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,13 @@ int is_staging_gitmodules_ok(const struct index_state *istate)
6969
return 1;
7070
}
7171

72+
static int for_each_remote_ref_submodule(const char *submodule,
73+
each_ref_fn fn, void *cb_data)
74+
{
75+
return refs_for_each_remote_ref(get_submodule_ref_store(submodule),
76+
fn, cb_data);
77+
}
78+
7279
/*
7380
* Try to update the "path" entry in the "submodule.<name>" section of the
7481
* .gitmodules file. Return 0 only if a .gitmodules file was found, a section

0 commit comments

Comments
 (0)