Skip to content

Commit ad17312

Browse files
stefanbellergitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 63d963a commit ad17312

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

unpack-trees.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2139,6 +2139,9 @@ int oneway_merge(const struct cache_entry * const *src,
21392139
ie_match_stat(o->src_index, old, &st, CE_MATCH_IGNORE_VALID|CE_MATCH_IGNORE_SKIP_WORKTREE))
21402140
update |= CE_UPDATE;
21412141
}
2142+
if (o->update && S_ISGITLINK(old->ce_mode) &&
2143+
should_update_submodules() && !verify_uptodate(old, o))
2144+
update |= CE_UPDATE;
21422145
add_entry(o, old, update, 0);
21432146
return 0;
21442147
}

0 commit comments

Comments
 (0)