diff options
author | Junio C Hamano <gitster@pobox.com> | 2019-01-29 12:47:54 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-01-29 12:47:54 -0800 |
commit | 5d3635db19c6dff4fb063fabfa4161fd3b8285f0 (patch) | |
tree | 30671c79e96d06267eda7d088a4ef7fd86c3ad47 /builtin/ls-files.c | |
parent | Merge branch 'jt/fetch-pack-v2' (diff) | |
parent | fetch: ensure submodule objects fetched (diff) | |
download | tgif-5d3635db19c6dff4fb063fabfa4161fd3b8285f0.tar.xz |
Merge branch 'sb/submodule-recursive-fetch-gets-the-tip'
"git fetch --recurse-submodules" may not fetch the necessary commit
that is bound to the superproject, which is getting corrected.
* sb/submodule-recursive-fetch-gets-the-tip:
fetch: ensure submodule objects fetched
submodule.c: fetch in submodules git directory instead of in worktree
submodule: migrate get_next_submodule to use repository structs
repository: repo_submodule_init to take a submodule struct
submodule: store OIDs in changed_submodule_names
submodule.c: tighten scope of changed_submodule_names struct
submodule.c: sort changed_submodule_names before searching it
submodule.c: fix indentation
sha1-array: provide oid_array_filter
Diffstat (limited to 'builtin/ls-files.c')
-rw-r--r-- | builtin/ls-files.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/builtin/ls-files.c b/builtin/ls-files.c index 7e0dcaa359..cde87cbeeb 100644 --- a/builtin/ls-files.c +++ b/builtin/ls-files.c @@ -206,17 +206,19 @@ static void show_files(struct repository *repo, struct dir_struct *dir); static void show_submodule(struct repository *superproject, struct dir_struct *dir, const char *path) { - struct repository submodule; + struct repository subrepo; + const struct submodule *sub = submodule_from_path(superproject, + &null_oid, path); - if (repo_submodule_init(&submodule, superproject, path)) + if (repo_submodule_init(&subrepo, superproject, sub)) return; - if (repo_read_index(&submodule) < 0) + if (repo_read_index(&subrepo) < 0) die("index file corrupt"); - show_files(&submodule, dir); + show_files(&subrepo, dir); - repo_clear(&submodule); + repo_clear(&subrepo); } static void show_ce(struct repository *repo, struct dir_struct *dir, |