Skip to content

Commit 588929d

Browse files
ao2gitster
authored andcommitted
submodule-config: make 'config_from_gitmodules' private
Now that 'config_from_gitmodules' is not used in the open, it can be marked as private. Hopefully this will prevent its usage for retrieving arbitrary configuration form the '.gitmodules' file. Signed-off-by: Antonio Ospite <[email protected]> Acked-by: Brandon Williams <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0574499 commit 588929d

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

submodule-config.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -673,14 +673,14 @@ void submodule_free(struct repository *r)
673673
}
674674

675675
/*
676-
* Note: This function exists solely to maintain backward compatibility with
677-
* 'fetch' and 'update_clone' storing configuration in '.gitmodules' and should
678-
* NOT be used anywhere else.
676+
* Note: This function is private for a reason, the '.gitmodules' file should
677+
* not be used as as a mechanism to retrieve arbitrary configuration stored in
678+
* the repository.
679679
*
680680
* Runs the provided config function on the '.gitmodules' file found in the
681681
* working directory.
682682
*/
683-
void config_from_gitmodules(config_fn_t fn, void *data)
683+
static void config_from_gitmodules(config_fn_t fn, void *data)
684684
{
685685
if (the_repository->worktree) {
686686
char *file = repo_worktree_path(the_repository, GITMODULES_FILE);

submodule-config.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,13 @@ void submodule_free(struct repository *r);
5757
int check_submodule_name(const char *name);
5858

5959
/*
60-
* Note: This function exists solely to maintain backward compatibility with
61-
* 'fetch' and 'update_clone' storing configuration in '.gitmodules' and should
62-
* NOT be used anywhere else.
60+
* Note: these helper functions exist solely to maintain backward
61+
* compatibility with 'fetch' and 'update_clone' storing configuration in
62+
* '.gitmodules'.
6363
*
64-
* Runs the provided config function on the '.gitmodules' file found in the
65-
* working directory.
64+
* New helpers to retrieve arbitrary configuration from the '.gitmodules' file
65+
* should NOT be added.
6666
*/
67-
extern void config_from_gitmodules(config_fn_t fn, void *data);
68-
6967
extern void fetch_config_from_gitmodules(int *max_children, int *recurse_submodules);
7068
extern void update_clone_config_from_gitmodules(int *max_jobs);
7169

0 commit comments

Comments
 (0)