diff options
| author | Junio C Hamano <gitster@pobox.com> | 2022-02-18 13:53:29 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2022-02-18 13:53:29 -0800 |
| commit | 5cc9522b1575f832db8fd9dc4974a8a67c59dcb8 (patch) | |
| tree | e56a8e9defb059735be0e9a1d7cd97ec2842c4ee /submodule.c | |
| parent | 7455e33cba53e015982ea6c61c49c2cfbadd7141 (diff) | |
| parent | 679e3693aba0c17af60c031f7eef68f2296b8dad (diff) | |
| download | git-5cc9522b1575f832db8fd9dc4974a8a67c59dcb8.tar.xz | |
Merge branch 'gc/branch-recurse-submodules'
"git branch" learned the "--recurse-submodules" option.
* gc/branch-recurse-submodules:
branch.c: use 'goto cleanup' in setup_tracking() to fix memory leaks
branch: add --recurse-submodules option for branch creation
builtin/branch: consolidate action-picking logic in cmd_branch()
branch: add a dry_run parameter to create_branch()
branch: make create_branch() always create a branch
branch: move --set-upstream-to behavior to dwim_and_setup_tracking()
Diffstat (limited to 'submodule.c')
| -rw-r--r-- | submodule.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/submodule.c b/submodule.c index c689070524..5ace18a7d9 100644 --- a/submodule.c +++ b/submodule.c @@ -267,7 +267,9 @@ int option_parse_recurse_submodules_worktree_updater(const struct option *opt, * ie, the config looks like: "[submodule] active\n". * Since that is an invalid pathspec, we should inform the user. */ -int is_submodule_active(struct repository *repo, const char *path) +int is_tree_submodule_active(struct repository *repo, + const struct object_id *treeish_name, + const char *path) { int ret = 0; char *key = NULL; @@ -275,7 +277,7 @@ int is_submodule_active(struct repository *repo, const char *path) const struct string_list *sl; const struct submodule *module; - module = submodule_from_path(repo, null_oid(), path); + module = submodule_from_path(repo, treeish_name, path); /* early return if there isn't a path->module mapping */ if (!module) @@ -317,6 +319,11 @@ int is_submodule_active(struct repository *repo, const char *path) return ret; } +int is_submodule_active(struct repository *repo, const char *path) +{ + return is_tree_submodule_active(repo, null_oid(), path); +} + int is_submodule_populated_gently(const char *path, int *return_error_code) { int ret = 0; |
