MCPcopy Index your code
hub / github.com/git/git / is_gitmodules_unmerged

Function is_gitmodules_unmerged

submodule.c:47–61  ·  view source on GitHub ↗

* Check if the .gitmodules file is unmerged. Parsing of the .gitmodules file * will be disabled because we can't guess what might be configured in * .gitmodules unless the user resolves the conflict. */

Source from the content-addressed store, hash-verified

45 * .gitmodules unless the user resolves the conflict.
46 */
47int is_gitmodules_unmerged(struct index_state *istate)
48{
49 int pos = index_name_pos(istate, GITMODULES_FILE, strlen(GITMODULES_FILE));
50 if (pos < 0) { /* .gitmodules not found or isn't merged */
51 pos = -1 - pos;
52 if (istate->cache_nr > pos) { /* there is a .gitmodules */
53 const struct cache_entry *ce = istate->cache[pos];
54 if (ce_namelen(ce) == strlen(GITMODULES_FILE) &&
55 !strcmp(ce->name, GITMODULES_FILE))
56 return 1;
57 }
58 }
59
60 return 0;
61}
62
63/*
64 * Check if the .gitmodules file is safe to write.

Calls 1

index_name_posFunction · 0.85

Tested by

no test coverage detected