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 202275b96b (submodule.c: get_super_prefix_or_empty, 2017-03-14), where we switched to using the environment global directly. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King committed
May 9, 2019 at 17:27 UTC
cf7a901ae4dff574e78d7b03bbaecfeb9dcc44d7
4 files changed
+9
-13
builtin/rm.c
+3
-3
@@ -61,7 +61,7 @@ static void print_error_files(struct string_list *files_list,
61
}
62
}
63
64
-static void submodules_absorb_gitdir_if_needed(const char *prefix)
64
+static void submodules_absorb_gitdir_if_needed(void)
65
{
66
int i;
67
for (i = 0; i < list.nr; i++) {
@@ -83,7 +83,7 @@ static void submodules_absorb_gitdir_if_needed(const char *prefix)
83
continue;
84
85
if (!submodule_uses_gitfile(name))
86
- absorb_git_dir_into_superproject(prefix, name,
86
+ absorb_git_dir_into_superproject(name,
87
ABSORB_GITDIR_RECURSE_SUBMODULES);
88
}
89
}
@@ -313,7 +313,7 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
313
}
314
315
if (!index_only)
316
- submodules_absorb_gitdir_if_needed(prefix);
316
+ submodules_absorb_gitdir_if_needed();
317
318
/*
319
* If not forced, the file, the index and the HEAD (if exists)
builtin/submodule--helper.c
+1
-2
@@ -2107,8 +2107,7 @@ static int absorb_git_dirs(int argc, const char **argv, const char *prefix)
2107
return 1;
2108
2109
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);
2111
2112
return 0;
2113
}
submodule.c
+4
-6
@@ -1910,7 +1910,7 @@ int submodule_move_head(const char *path,
1910
if (!(flags & SUBMODULE_MOVE_HEAD_DRY_RUN)) {
1911
if (old_head) {
1912
if (!submodule_uses_gitfile(path))
1913
- absorb_git_dir_into_superproject("", path,
1913
+ absorb_git_dir_into_superproject(path,
1914
ABSORB_GITDIR_RECURSE_SUBMODULES);
1915
} else {
1916
char *gitdir = xstrfmt("%s/modules/%s",
@@ -1997,8 +1997,7 @@ out:
1997
* Embeds a single submodules git directory into the superprojects git dir,
1998
* non recursively.
1999
*/
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)
2001
{
2002
char *old_git_dir = NULL, *real_old_git_dir = NULL, *real_new_git_dir = NULL;
2003
const char *new_git_dir;
@@ -2040,8 +2039,7 @@ static void relocate_single_git_dir_into_superproject(const char *prefix,
2039
* having its git directory within the working tree to the git dir nested
2040
* in its superprojects git dir under modules/.
2041
*/
2043
-void absorb_git_dir_into_superproject(const char *prefix,
2044
- const char *path,
2042
+void absorb_git_dir_into_superproject(const char *path,
2043
unsigned flags)
2044
{
2045
int err_code;
@@ -2082,7 +2080,7 @@ void absorb_git_dir_into_superproject(const char *prefix,
2080
char *real_common_git_dir = real_pathdup(get_git_common_dir(), 1);
2081
2082
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);
2084
2085
free(real_sub_git_dir);
2086
free(real_common_git_dir);
submodule.h
+1
-2
@@ -141,8 +141,7 @@ void submodule_unset_core_worktree(const struct submodule *sub);
141
void prepare_submodule_repo_env(struct argv_array *out);
142
143
#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,
145
unsigned flags);
146
147
/*