MCPcopy Create free account
hub / github.com/git/git / check_submodule_move_head

Function check_submodule_move_head

unpack-trees.c:315–333  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

313 fprintf(stderr, _("After fixing the above paths, you may want to run `git sparse-checkout reapply`.\n"));
314}
315static int check_submodule_move_head(const struct cache_entry *ce,
316 const char *old_id,
317 const char *new_id,
318 struct unpack_trees_options *o)
319{
320 unsigned flags = SUBMODULE_MOVE_HEAD_DRY_RUN;
321 const struct submodule *sub = submodule_from_ce(ce);
322
323 if (!sub)
324 return 0;
325
326 if (o->reset)
327 flags |= SUBMODULE_MOVE_HEAD_FORCE;
328
329 if (submodule_move_head(ce->name, o->super_prefix, old_id, new_id,
330 flags))
331 return add_rejected_path(o, ERROR_WOULD_LOSE_SUBMODULE, ce->name);
332 return 0;
333}
334
335/*
336 * Perform the loading of the repository's gitmodules file. This function is

Callers 4

verify_uptodate_1Function · 0.85
verify_clean_submoduleFunction · 0.85
verify_absent_1Function · 0.85
merged_entryFunction · 0.85

Calls 3

submodule_from_ceFunction · 0.85
submodule_move_headFunction · 0.85
add_rejected_pathFunction · 0.85

Tested by

no test coverage detected