diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2022-11-08 15:10:37 +0100 |
---|---|---|
committer | Taylor Blau <me@ttaylorr.com> | 2022-11-08 20:55:30 +0100 |
commit | 82ff87789bdd972c9746ec184ae9464e58c8d29b (patch) | |
tree | 2b02a6b0b868cf08ea00f9fee976b61cb9a1a07a /submodule.c | |
parent | submodule.c: refactor recursive block out of absorb function (diff) | |
download | git-82ff87789bdd972c9746ec184ae9464e58c8d29b.tar.xz git-82ff87789bdd972c9746ec184ae9464e58c8d29b.zip |
submodule API & "absorbgitdirs": remove "----recursive" option
Remove the "----recursive" option to "git submodule--helper
absorbgitdirs" (yes, with 4 dashes, not 2).
This option and all the "else" when "flags &
ABSORB_GITDIR_RECURSE_SUBMODULES" is false has never been used since
it was added in f6f85861400 (submodule: add absorb-git-dir function,
2016-12-12), which we'd have had to do as "----recursive", a
"--recursive" would have errored out.
It would be nice to follow-up with an optbug() assertion to
parse-options.c for such funnily named options, I manually validated
that this was the only long option whose name started with "-", but
let's skip adding such an assertion for now.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Diffstat (limited to 'submodule.c')
-rw-r--r-- | submodule.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/submodule.c b/submodule.c index fe1e3f0390..8fa2ad457b 100644 --- a/submodule.c +++ b/submodule.c @@ -2139,8 +2139,7 @@ int submodule_move_head(const char *path, if (!(flags & SUBMODULE_MOVE_HEAD_DRY_RUN)) { if (old_head) { if (!submodule_uses_gitfile(path)) - absorb_git_dir_into_superproject(path, - ABSORB_GITDIR_RECURSE_SUBMODULES); + absorb_git_dir_into_superproject(path); } else { struct strbuf gitdir = STRBUF_INIT; submodule_name_to_gitdir(&gitdir, the_repository, @@ -2332,8 +2331,7 @@ static void absorb_git_dir_into_superproject_recurse(const char *path) * having its git directory within the working tree to the git dir nested * in its superprojects git dir under modules/. */ -void absorb_git_dir_into_superproject(const char *path, - unsigned flags) +void absorb_git_dir_into_superproject(const char *path) { int err_code; const char *sub_git_dir; @@ -2382,12 +2380,7 @@ void absorb_git_dir_into_superproject(const char *path, } strbuf_release(&gitdir); - if (flags & ABSORB_GITDIR_RECURSE_SUBMODULES) { - if (flags & ~ABSORB_GITDIR_RECURSE_SUBMODULES) - BUG("we don't know how to pass the flags down?"); - - absorb_git_dir_into_superproject_recurse(path); - } + absorb_git_dir_into_superproject_recurse(path); } int get_superproject_working_tree(struct strbuf *buf) |