Skip to content

Commit cf7a901

Browse files
peffgitster
authored andcommitted
submodule: drop unused prefix parameter from some functions
We stopped using the "prefix" parameter of relocate_single_git_dir_into_superproject() and its callers in 202275b (submodule.c: get_super_prefix_or_empty, 2017-03-14), where we switched to using the environment global directly. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d64db5b commit cf7a901

File tree

4 files changed

+9
-13
lines changed

4 files changed

+9
-13
lines changed

builtin/rm.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ static void print_error_files(struct string_list *files_list,
6161
}
6262
}
6363

64-
static void submodules_absorb_gitdir_if_needed(const char *prefix)
64+
static void submodules_absorb_gitdir_if_needed(void)
6565
{
6666
int i;
6767
for (i = 0; i < list.nr; i++) {
@@ -83,7 +83,7 @@ static void submodules_absorb_gitdir_if_needed(const char *prefix)
8383
continue;
8484

8585
if (!submodule_uses_gitfile(name))
86-
absorb_git_dir_into_superproject(prefix, name,
86+
absorb_git_dir_into_superproject(name,
8787
ABSORB_GITDIR_RECURSE_SUBMODULES);
8888
}
8989
}
@@ -313,7 +313,7 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
313313
}
314314

315315
if (!index_only)
316-
submodules_absorb_gitdir_if_needed(prefix);
316+
submodules_absorb_gitdir_if_needed();
317317

318318
/*
319319
* If not forced, the file, the index and the HEAD (if exists)

builtin/submodule--helper.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -2107,8 +2107,7 @@ static int absorb_git_dirs(int argc, const char **argv, const char *prefix)
21072107
return 1;
21082108

21092109
for (i = 0; i < list.nr; i++)
2110-
absorb_git_dir_into_superproject(prefix,
2111-
list.entries[i]->name, flags);
2110+
absorb_git_dir_into_superproject(list.entries[i]->name, flags);
21122111

21132112
return 0;
21142113
}

submodule.c

+4-6
Original file line numberDiff line numberDiff line change
@@ -1910,7 +1910,7 @@ int submodule_move_head(const char *path,
19101910
if (!(flags & SUBMODULE_MOVE_HEAD_DRY_RUN)) {
19111911
if (old_head) {
19121912
if (!submodule_uses_gitfile(path))
1913-
absorb_git_dir_into_superproject("", path,
1913+
absorb_git_dir_into_superproject(path,
19141914
ABSORB_GITDIR_RECURSE_SUBMODULES);
19151915
} else {
19161916
char *gitdir = xstrfmt("%s/modules/%s",
@@ -1997,8 +1997,7 @@ int submodule_move_head(const char *path,
19971997
* Embeds a single submodules git directory into the superprojects git dir,
19981998
* non recursively.
19991999
*/
2000-
static void relocate_single_git_dir_into_superproject(const char *prefix,
2001-
const char *path)
2000+
static void relocate_single_git_dir_into_superproject(const char *path)
20022001
{
20032002
char *old_git_dir = NULL, *real_old_git_dir = NULL, *real_new_git_dir = NULL;
20042003
const char *new_git_dir;
@@ -2040,8 +2039,7 @@ static void relocate_single_git_dir_into_superproject(const char *prefix,
20402039
* having its git directory within the working tree to the git dir nested
20412040
* in its superprojects git dir under modules/.
20422041
*/
2043-
void absorb_git_dir_into_superproject(const char *prefix,
2044-
const char *path,
2042+
void absorb_git_dir_into_superproject(const char *path,
20452043
unsigned flags)
20462044
{
20472045
int err_code;
@@ -2082,7 +2080,7 @@ void absorb_git_dir_into_superproject(const char *prefix,
20822080
char *real_common_git_dir = real_pathdup(get_git_common_dir(), 1);
20832081

20842082
if (!starts_with(real_sub_git_dir, real_common_git_dir))
2085-
relocate_single_git_dir_into_superproject(prefix, path);
2083+
relocate_single_git_dir_into_superproject(path);
20862084

20872085
free(real_sub_git_dir);
20882086
free(real_common_git_dir);

submodule.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,7 @@ void submodule_unset_core_worktree(const struct submodule *sub);
141141
void prepare_submodule_repo_env(struct argv_array *out);
142142

143143
#define ABSORB_GITDIR_RECURSE_SUBMODULES (1<<0)
144-
void absorb_git_dir_into_superproject(const char *prefix,
145-
const char *path,
144+
void absorb_git_dir_into_superproject(const char *path,
146145
unsigned flags);
147146

148147
/*

0 commit comments

Comments
 (0)