summaryrefslogtreecommitdiff
path: root/unpack-trees.c
diff options
context:
space:
mode:
authorStefan Beller <sbeller@google.com>2018-01-05 20:03:03 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-01-05 20:35:35 (GMT)
commitad17312e1170715a15651b3185dae9ebc6b6b8ef (patch)
tree572ede7e7432e4a9415282111df15f9f8711c93b /unpack-trees.c
parent63d963a4706c6a085f6d790d7e589de3e9b369a4 (diff)
downloadgit-ad17312e1170715a15651b3185dae9ebc6b6b8ef.zip
git-ad17312e1170715a15651b3185dae9ebc6b6b8ef.tar.gz
git-ad17312e1170715a15651b3185dae9ebc6b6b8ef.tar.bz2
unpack-trees: oneway_merge to update submodules
When there is a one way merge, each submodule needs to be one way merged as well, if we're asked to recurse into submodules. In case of a submodule, check if it is up-to-date, otherwise set the flag CE_UPDATE, which will trigger an update of it in the phase updating the tree later. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'unpack-trees.c')
-rw-r--r--unpack-trees.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/unpack-trees.c b/unpack-trees.c
index bf8b602..96c3327 100644
--- a/unpack-trees.c
+++ b/unpack-trees.c
@@ -2139,6 +2139,9 @@ int oneway_merge(const struct cache_entry * const *src,
ie_match_stat(o->src_index, old, &st, CE_MATCH_IGNORE_VALID|CE_MATCH_IGNORE_SKIP_WORKTREE))
update |= CE_UPDATE;
}
+ if (o->update && S_ISGITLINK(old->ce_mode) &&
+ should_update_submodules() && !verify_uptodate(old, o))
+ update |= CE_UPDATE;
add_entry(o, old, update, 0);
return 0;
}