* 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. */
| 45 | * .gitmodules unless the user resolves the conflict. |
| 46 | */ |
| 47 | int 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. |
no test coverage detected