Branch Coverage

deps/libgit2/src/libgit2/submodule.c
Criterion Covered Total %
branch 1 766 0.1


line true false branch
99 0 0 if (!error)
102 0 0 git_error_set(GIT_ERROR_SUBMODULE, (error == GIT_ENOTFOUND) ?
116 0 0 if (!strcmp(entry->value, data->path)) {
121 0 0 GIT_ERROR_CHECK_ALLOC(data->name);
138 0 0 if ((error = git_repository_index__weakptr(&index, repo)) < 0)
141 0 0 if ((error = git_index_find(NULL, index, path)) != GIT_ENOTFOUND) {
142 0 0 if (!error) {
150 0 0 if ((error = git_str_sets(&dir, path)) < 0)
153 0 0 if ((error = git_fs_path_to_dir(&dir)) < 0)
156 0 0 if ((error = git_index_find_prefix(NULL, index, dir.ptr)) != GIT_ENOTFOUND) {
157 0 0 if (!error) {
180 0 0 if (names == NULL)
183 0 0 git_strmap_foreach(names, key, value, {
208 0 0 if ((error = git_strmap_new(&names)) < 0)
211 0 0 if ((error = git_config_iterator_glob_new(&iter, cfg, key)) < 0)
214 0 0 while ((error = git_config_next(&entry, iter)) == 0) {
219 0 0 if (git_strmap_exists(names, entry->value)) {
229 0 0 if (isvalid < 0) {
233 0 0 if (!isvalid)
236 0 0 if ((error = git_strmap_set(names, git__strdup(entry->value), git_str_detach(&buf))) < 0) {
242 0 0 if (error == GIT_ITEROVER)
259 0 0 GIT_ASSERT_ARG(out);
260 0 0 GIT_ASSERT_ARG(repo);
261 0 0 if ((error = git_strmap_new(&cache)) < 0)
263 0 0 if ((error = git_submodule__map(repo, cache)) < 0) {
274 63 0 if (cache == NULL)
276 0 0 git_strmap_foreach_value(cache, sm, {
301 0 0 GIT_ASSERT_ARG(repo);
302 0 0 GIT_ASSERT_ARG(name);
304 0 0 if (repo->is_bare) {
309 0 0 if (cache != NULL) {
310 0 0 if ((sm = git_strmap_get(cache, name)) != NULL) {
311 0 0 if (out) {
319 0 0 if ((error = submodule_alloc(&sm, repo, name)) < 0)
322 0 0 if ((error = git_submodule_reload(sm, false)) < 0) {
327 0 0 if ((error = git_submodule_location(&location, sm)) < 0) {
333 0 0 if (location == 0 || location == GIT_SUBMODULE_STATUS_IN_WD) {
0 0 if (location == 0 || location == GIT_SUBMODULE_STATUS_IN_WD) {
340 0 0 while (path.ptr[path.size-1] == '/') {
347 0 0 if (mods)
352 0 0 if (error < 0) {
358 0 0 if (data.name) {
364 0 0 if ((error = git_submodule_reload(sm, false)) < 0) {
373 0 0 if ((error = git_submodule_location(&location, sm)) < 0) {
379 0 0 if (location == 0 || location == GIT_SUBMODULE_STATUS_IN_WD) {
0 0 if (location == 0 || location == GIT_SUBMODULE_STATUS_IN_WD) {
384 0 0 if (git_repository_workdir(repo)) {
386 0 0 if (git_str_join3(&path, '/',
388 0 0 name, DOT_GIT) < 0 ||
392 0 0 if (git_fs_path_exists(path.ptr))
402 0 0 if (out)
415 0 0 if (flags == 0)
419 0 0 if (strchr(name, '\\') != NULL) {
420 0 0 if ((error = git_fs_path_normalize_slashes(&buf, name)) < 0)
442 0 0 if ((sm = git_strmap_get(map, name)) != NULL)
446 0 0 if ((error = submodule_alloc(&sm, repo, name)) < 0)
449 0 0 if ((error = git_strmap_set(map, sm->name, sm)) < 0) {
467 0 0 if ((error = load_submodule_names(&names, git_index_owner(idx), cfg)))
470 0 0 if ((error = git_iterator_for_index(&i, git_index_owner(idx), idx, NULL)) < 0)
473 0 0 while (!(error = git_iterator_advance(&entry, i))) {
476 0 0 if ((sm = git_strmap_get(map, entry->path)) != NULL) {
477 0 0 if (S_ISGITLINK(entry->mode))
481 0 0 } else if (S_ISGITLINK(entry->mode)) {
484 0 0 if ((name = git_strmap_get(names, entry->path)) == NULL)
487 0 0 if (!submodule_get_or_create(&sm, git_index_owner(idx), map, name)) {
494 0 0 if (error == GIT_ITEROVER)
511 0 0 if ((error = load_submodule_names(&names, git_tree_owner(head), cfg)))
514 0 0 if ((error = git_iterator_for_tree(&i, head, NULL)) < 0)
517 0 0 while (!(error = git_iterator_advance(&entry, i))) {
520 0 0 if ((sm = git_strmap_get(map, entry->path)) != NULL) {
521 0 0 if (S_ISGITLINK(entry->mode))
525 0 0 } else if (S_ISGITLINK(entry->mode)) {
528 0 0 if ((name = git_strmap_get(names, entry->path)) == NULL)
531 0 0 if (!submodule_get_or_create(&sm, git_tree_owner(head), map, name)) {
539 0 0 if (error == GIT_ITEROVER)
566 0 0 GIT_ASSERT_ARG(repo);
567 0 0 GIT_ASSERT_ARG(map);
570 0 0 if (git_repository_index(&idx, repo) < 0)
572 0 0 if (git_repository_head_tree(&head, repo) < 0)
577 0 0 if (has_workdir &&
0 0 if (has_workdir &&
582 0 0 if (has_workdir) {
587 0 0 if ((error = gitmodules_snapshot(&mods, repo)) < 0) {
588 0 0 if (error == GIT_ENOTFOUND)
594 0 0 if ((error = git_config_foreach(
599 0 0 if (mods && idx) {
0 0 if (mods && idx) {
600 0 0 if ((error = submodules_from_index(map, idx, mods)) < 0)
604 0 0 if (mods && head) {
0 0 if (mods && head) {
605 0 0 if ((error = submodules_from_head(map, head, mods)) < 0)
609 0 0 if (has_workdir) {
610 0 0 git_strmap_foreach_value(map, sm, {
635 0 0 if (repo->is_bare) {
640 0 0 if ((error = git_strmap_new(&submodules)) < 0)
643 0 0 if ((error = git_submodule__map(repo, submodules)) < 0)
646 0 0 if (!(error = git_vector_init(
649 0 0 git_strmap_foreach_value(submodules, sm, {
0 0 git_strmap_foreach_value(submodules, sm, {
656 0 0 if (error < 0)
661 0 0 git_vector_foreach(&snapshot, i, sm) {
662 0 0 if ((error = callback(sm, sm->name, payload)) != 0) {
669 0 0 git_vector_foreach(&snapshot, i, sm)
673 0 0 git_strmap_foreach_value(submodules, sm, {
694 0 0 if (error < 0)
707 0 0 if (use_gitlink) {
709 0 0 if (error < 0)
712 0 0 if (error < 0)
741 0 0 GIT_ASSERT_ARG(out);
742 0 0 GIT_ASSERT_ARG(repo);
743 0 0 GIT_ASSERT_ARG(url);
746 0 0 if (strchr(url, '\\')) {
747 0 0 if ((error = git_fs_path_normalize_slashes(&normalized, url)) < 0)
754 0 0 if (git_fs_path_is_relative(url)) {
755 0 0 if (!(error = get_url_base(out, repo)))
757 0 0 } else if (strchr(url, ':') != NULL || url[0] == '/') {
0 0 } else if (strchr(url, ':') != NULL || url[0] == '/') {
773 0 0 GIT_BUF_WRAP_PRIVATE(out, git_submodule__resolve_url, repo, url);
0 0 GIT_BUF_WRAP_PRIVATE(out, git_submodule__resolve_url, repo, url);
790 0 0 GIT_ASSERT_ARG(repo);
791 0 0 GIT_ASSERT_ARG(url);
792 0 0 GIT_ASSERT_ARG(path);
796 0 0 if (git_submodule_lookup(NULL, repo, path) < 0)
806 0 0 if (git__prefixcmp(path, git_repository_workdir(repo)) == 0)
809 0 0 if (git_fs_path_root(path) >= 0) {
815 0 0 if ((error = is_path_occupied(&path_occupied, repo, path)) < 0)
818 0 0 if (path_occupied) {
825 0 0 if (!(mods = open_gitmodules(repo, GITMODULES_CREATE))) {
831 0 0 if ((error = git_str_printf(&name, "submodule.%s.path", path)) < 0 ||
0 0 if ((error = git_str_printf(&name, "submodule.%s.path", path)) < 0 ||
835 0 0 if ((error = submodule_config_key_trunc_puts(&name, "url")) < 0 ||
0 0 if ((error = submodule_config_key_trunc_puts(&name, "url")) < 0 ||
844 0 0 if (error < 0)
854 0 0 if ((error = git_submodule__resolve_url(&real_url, repo, url)) < 0)
857 0 0 if ((error = submodule_repo_init(&subrepo, repo, path, real_url.ptr, use_gitlink)) < 0)
861 0 0 if ((error = git_submodule_lookup(&sm, repo, path)) < 0)
867 0 0 if (error && sm) {
0 0 if (error && sm) {
871 0 0 if (out != NULL)
893 0 0 GIT_ASSERT_ARG(out);
894 0 0 GIT_ASSERT_ARG(sm);
897 0 0 if ((error = git_str_printf(&buf, "submodule.%s.url", sm->name)) < 0 ||
0 0 if ((error = git_str_printf(&buf, "submodule.%s.url", sm->name)) < 0 ||
898 0 0 (error = git_repository_config_snapshot(&cfg, sm->repo)) < 0 ||
899 0 0 (error = git_config_get_string(&configured_url, cfg, buf.ptr)) < 0 ||
935 0 0 GIT_ASSERT_ARG(submodule);
937 0 0 if (given_opts)
940 0 0 GIT_ERROR_CHECK_VERSION(&sub_opts, GIT_SUBMODULE_UPDATE_OPTIONS_VERSION, "git_submodule_update_options");
950 0 0 if (error < 0)
954 0 0 if (error < 0)
957 0 0 if (!out)
973 0 0 GIT_ASSERT_ARG(sm);
975 0 0 if ((error = git_repository_index__weakptr(&index, sm->repo)) < 0 ||
0 0 if ((error = git_repository_index__weakptr(&index, sm->repo)) < 0 ||
992 0 0 GIT_ASSERT_ARG(sm);
997 0 0 if ((error = git_repository_index__weakptr(&index, sm->repo)) < 0 ||
0 0 if ((error = git_repository_index__weakptr(&index, sm->repo)) < 0 ||
998 0 0 (error = git_repository_workdir_path(&path, sm->repo, sm->path)) < 0 ||
1003 0 0 if (p_stat(path.ptr, &st) < 0) {
1016 0 0 if ((sm->flags & GIT_SUBMODULE_STATUS__WD_OID_VALID) == 0) {
1024 0 0 if ((error = git_commit_lookup(&head, sm_repo, &sm->wd_oid)) < 0)
1038 0 0 if (!error && write_index) {
0 0 if (!error && write_index) {
1041 0 0 if (!error)
1054 0 0 for (i = 0; i < (int)ARRAY_SIZE(_sm_update_map); ++i)
1055 0 0 if (_sm_update_map[i].map_value == (int)update)
1062 0 0 GIT_ASSERT_ARG_WITH_RETVAL(submodule, NULL);
1068 0 0 GIT_ASSERT_ARG_WITH_RETVAL(submodule, NULL);
1074 0 0 GIT_ASSERT_ARG_WITH_RETVAL(submodule, NULL);
1080 0 0 GIT_ASSERT_ARG_WITH_RETVAL(submodule, NULL);
1091 0 0 if (!mods)
1094 0 0 if ((error = git_str_printf(&key, "submodule.%s.%s", name, var)) < 0)
1097 0 0 if (val)
1114 0 0 if (git_config_lookup_map_enum(&type, &val, maps, nmaps, ival) < 0) {
1119 0 0 if (type == GIT_CONFIGMAP_TRUE)
1127 0 0 GIT_ASSERT_ARG_WITH_RETVAL(submodule, NULL);
1133 0 0 GIT_ASSERT_ARG(repo);
1134 0 0 GIT_ASSERT_ARG(name);
1141 0 0 GIT_ASSERT_ARG(repo);
1142 0 0 GIT_ASSERT_ARG(name);
1143 0 0 GIT_ASSERT_ARG(url);
1150 0 0 GIT_ASSERT_ARG_WITH_RETVAL(submodule, NULL);
1152 0 0 if (submodule->flags & GIT_SUBMODULE_STATUS__INDEX_OID_VALID)
1160 0 0 GIT_ASSERT_ARG_WITH_RETVAL(submodule, NULL);
1162 0 0 if (submodule->flags & GIT_SUBMODULE_STATUS__HEAD_OID_VALID)
1170 0 0 GIT_ASSERT_ARG_WITH_RETVAL(submodule, NULL);
1173 0 0 if (!(submodule->flags & GIT_SUBMODULE_STATUS__WD_OID_VALID)) {
1177 0 0 if (!git_submodule_open_bare(&subrepo, submodule))
1183 0 0 if (submodule->flags & GIT_SUBMODULE_STATUS__WD_OID_VALID)
1191 0 0 GIT_ASSERT_ARG_WITH_RETVAL(submodule, GIT_SUBMODULE_IGNORE_UNSPECIFIED);
1199 0 0 GIT_ASSERT_ARG(repo);
1200 0 0 GIT_ASSERT_ARG(name);
1207 0 0 GIT_ASSERT_ARG_WITH_RETVAL(submodule, GIT_SUBMODULE_UPDATE_NONE);
1209 0 0 return (submodule->update < GIT_SUBMODULE_UPDATE_CHECKOUT) ?
1215 0 0 GIT_ASSERT_ARG(repo);
1216 0 0 GIT_ASSERT_ARG(name);
1224 0 0 GIT_ASSERT_ARG_WITH_RETVAL(submodule, GIT_SUBMODULE_RECURSE_NO);
1230 0 0 GIT_ASSERT_ARG(repo);
1231 0 0 GIT_ASSERT_ARG(name);
1254 0 0 if (error < 0)
1265 0 0 if (error < 0)
1268 0 0 if (error < 0)
1303 0 0 GIT_INIT_STRUCTURE_FROM_TEMPLATE(
1328 0 0 GIT_ASSERT_ARG(sm);
1330 0 0 if (_update_options)
1333 0 0 GIT_ERROR_CHECK_VERSION(&update_options, GIT_SUBMODULE_UPDATE_OPTIONS_VERSION, "git_submodule_update_options");
1339 0 0 if ((error = git_submodule_status(&submodule_status, sm->repo, sm->name, GIT_SUBMODULE_IGNORE_UNSPECIFIED)) < 0)
1346 0 0 if (submodule_status & GIT_SUBMODULE_STATUS_WD_UNINITIALIZED) {
1351 0 0 if ((error = git_repository_config_snapshot(&config, sm->repo)) < 0 ||
0 0 if ((error = git_repository_config_snapshot(&config, sm->repo)) < 0 ||
1355 0 0 if ((error = git_config_get_string(&submodule_url, config, git_str_cstr(&buf))) < 0) {
1360 0 0 if (error != GIT_ENOTFOUND)
1363 0 0 if (!init) {
1370 0 0 if ((error = git_submodule_init(sm, 0)) < 0)
1376 0 0 if ((error = git_repository_config_snapshot(&config, sm->repo)) < 0 ||
0 0 if ((error = git_repository_config_snapshot(&config, sm->repo)) < 0 ||
1392 0 0 if ((error = git_clone(&sub_repo, submodule_url, sm->path, &clone_options)) < 0 ||
0 0 if ((error = git_clone(&sub_repo, submodule_url, sm->path, &clone_options)) < 0 ||
1404 0 0 if ((error = git_submodule_open(&sub_repo, sm)) < 0)
1407 0 0 if ((oid = git_submodule_index_id(sm)) == NULL) {
1414 0 0 if ((error = git_object_lookup(&target_commit, sub_repo, oid, GIT_OBJECT_COMMIT)) < 0) {
1416 0 0 if (error != GIT_ENOTFOUND || !update_options.allow_fetch ||
0 0 if (error != GIT_ENOTFOUND || !update_options.allow_fetch ||
0 0 if (error != GIT_ENOTFOUND || !update_options.allow_fetch ||
1417 0 0 (error = lookup_default_remote(&remote, sub_repo)) < 0 ||
1418 0 0 (error = git_remote_fetch(remote, NULL, &update_options.fetch_opts, NULL)) < 0 ||
1423 0 0 if ((error = git_checkout_tree(sub_repo, target_commit, &update_options.checkout_opts)) != 0 ||
0 0 if ((error = git_checkout_tree(sub_repo, target_commit, &update_options.checkout_opts)) != 0 ||
1451 0 0 if (!sm->url) {
1457 0 0 if ((error = git_repository_config(&cfg, sm->repo)) < 0)
1462 0 0 if ((error = git_submodule__resolve_url(&effective_submodule_url, sm->repo, sm->url)) < 0 ||
0 0 if ((error = git_submodule__resolve_url(&effective_submodule_url, sm->repo, sm->url)) < 0 ||
1463 0 0 (error = git_str_printf(&key, "submodule.%s.url", sm->name)) < 0 ||
1471 0 0 NULL : submodule_update_to_str(sm->update);
1473 0 0 if ((error = git_str_printf(&key, "submodule.%s.update", sm->name)) < 0 ||
1495 0 0 if (!sm->url) {
1501 0 0 if ((error = git_repository_config__weakptr(&cfg, sm->repo)) < 0 ||
0 0 if ((error = git_repository_config__weakptr(&cfg, sm->repo)) < 0 ||
1502 0 0 (error = git_str_printf(&key, "submodule.%s.url", sm->name)) < 0 ||
1503 0 0 (error = git_submodule__resolve_url(&url, sm->repo, sm->url)) < 0 ||
1507 0 0 if (!(sm->flags & GIT_SUBMODULE_STATUS_IN_WD))
1511 0 0 if ((error = git_submodule_open(&smrepo, sm)) < 0 ||
0 0 if ((error = git_submodule_open(&smrepo, sm)) < 0 ||
1515 0 0 if (lookup_head_remote_key(&remote_name, smrepo) == 0) {
1516 0 0 if ((error = git_str_join3(&key, '.', "remote", remote_name.ptr, "url")) < 0)
1518 0 0 } else if ((error = git_str_sets(&key, "remote.origin.url")) < 0) {
1522 0 0 if ((error = git_config__update_entry(cfg, key.ptr, url.ptr, true, false)) < 0)
1541 0 0 GIT_ASSERT_ARG(sm);
1542 0 0 GIT_ASSERT_ARG(subrepo);
1544 0 0 if (git_repository__ensure_not_bare(
1550 0 0 if (git_str_join3(&path, '/', wd, sm->path, DOT_GIT) < 0)
1558 0 0 if (bare)
1564 0 0 if (!error) {
1568 0 0 if (!git_reference_name_to_id(&sm->wd_oid, *subrepo, GIT_HEAD_FILE))
1572 0 0 } else if (git_fs_path_exists(path.ptr)) {
1578 0 0 if (git_fs_path_isdir(path.ptr))
1602 0 0 if (!S_ISGITLINK(ie->mode)) {
1603 0 0 if (!already_found)
1606 0 0 if (already_found)
1621 0 0 if (git_repository_index__weakptr(&index, sm->repo) < 0)
1628 0 0 if (!(ie = git_index_get_bypath(index, sm->path, 0)))
1639 0 0 if (!S_ISGITLINK(mode))
1677 0 0 GIT_ASSERT_ARG(sm);
1679 0 0 if ((error = git_submodule_name_is_valid(sm->repo, sm->name, 0)) <= 0)
1683 0 0 if (git_repository_is_bare(sm->repo))
1687 0 0 if ((error = gitmodules_snapshot(&mods, sm->repo)) < 0 && error != GIT_ENOTFOUND)
0 0 if ((error = gitmodules_snapshot(&mods, sm->repo)) < 0 && error != GIT_ENOTFOUND)
1690 0 0 if (mods != NULL && (error = submodule_read_config(sm, mods)) < 0)
0 0 if (mods != NULL && (error = submodule_read_config(sm, mods)) < 0)
1699 0 0 if ((error = submodule_load_from_wd_lite(sm)) < 0 ||
0 0 if ((error = submodule_load_from_wd_lite(sm)) < 0 ||
1712 0 0 if (tgt) {
1713 0 0 if (valid)
1731 0 0 if (ign == GIT_SUBMODULE_IGNORE_UNSPECIFIED)
1735 0 0 if (ign == GIT_SUBMODULE_IGNORE_ALL) {
1747 0 0 if (sm->repo->submodule_cache == NULL) {
1749 0 0 if (submodule_update_index(sm) < 0)
1753 0 0 if (submodule_update_head(sm) < 0)
1758 0 0 if (ign == GIT_SUBMODULE_IGNORE_DIRTY) {
1760 0 0 if (git_submodule_open_bare(&smrepo, sm) < 0)
1765 0 0 } else if (git_submodule_open(&smrepo, sm) < 0) {
1794 0 0 GIT_ASSERT_ARG(status);
1795 0 0 GIT_ASSERT_ARG(repo);
1796 0 0 GIT_ASSERT_ARG(name);
1798 0 0 if ((error = git_submodule_lookup(&sm, repo, name)) < 0)
1809 0 0 GIT_ASSERT_ARG(location);
1810 0 0 GIT_ASSERT_ARG(sm);
1826 0 0 if (!name || !(namelen = strlen(name))) {
0 0 if (!name || !(namelen = strlen(name))) {
1832 0 0 GIT_ERROR_CHECK_ALLOC(sm);
1835 0 0 if (!sm->name) {
1853 0 0 if (!sm)
1856 0 0 if (sm->repo) {
1860 0 0 if (sm->path != sm->name)
1871 0 0 GIT_ASSERT_ARG(out);
1872 0 0 GIT_ASSERT_ARG(source);
1882 0 0 if (!sm)
1884 0 0 GIT_REFCOUNT_DEC(sm, submodule_release);
0 0 GIT_REFCOUNT_DEC(sm, submodule_release);
1898 0 0 if (git_config_lookup_map_value(
1912 0 0 if (git_config_lookup_map_value(
1926 0 0 if (git_config_lookup_map_value(
1942 0 0 if ((error = git_str_printf(buf, "submodule.%s.%s", name, field)) < 0 ||
0 0 if ((error = git_str_printf(buf, "submodule.%s.%s", name, field)) < 0 ||
1951 0 0 if (s && s[0] == '-')
0 0 if (s && s[0] == '-')
1968 0 0 if ((error = get_value(&value, cfg, &key, sm->name, "path")) == 0) {
1971 0 0 if (!looks_like_command_line_option(value)) {
1976 0 0 if (strcmp(sm->name, value) != 0) {
1977 0 0 if (sm->path != sm->name)
1980 0 0 GIT_ERROR_CHECK_ALLOC(sm->path);
1984 0 0 } else if (error != GIT_ENOTFOUND) {
1988 0 0 if ((error = get_value(&value, cfg, &key, sm->name, "url")) == 0) {
1990 0 0 if (!looks_like_command_line_option(value)) {
1993 0 0 GIT_ERROR_CHECK_ALLOC(sm->url);
1995 0 0 } else if (error != GIT_ENOTFOUND) {
1999 0 0 if ((error = get_value(&value, cfg, &key, sm->name, "branch")) == 0) {
2002 0 0 GIT_ERROR_CHECK_ALLOC(sm->branch);
2003 0 0 } else if (error != GIT_ENOTFOUND) {
2007 0 0 if ((error = get_value(&value, cfg, &key, sm->name, "update")) == 0) {
2009 0 0 if ((error = git_submodule_parse_update(&sm->update, value)) < 0)
2012 0 0 } else if (error != GIT_ENOTFOUND) {
2016 0 0 if ((error = get_value(&value, cfg, &key, sm->name, "fetchRecurseSubmodules")) == 0) {
2018 0 0 if ((error = submodule_parse_recurse(&sm->fetch_recurse, value)) < 0)
2021 0 0 } else if (error != GIT_ENOTFOUND) {
2025 0 0 if ((error = get_value(&value, cfg, &key, sm->name, "ignore")) == 0) {
2027 0 0 if ((error = git_submodule_parse_ignore(&sm->ignore, value)) < 0)
2030 0 0 } else if (error != GIT_ENOTFOUND) {
2034 0 0 if (in_config)
2053 0 0 if (git__prefixcmp(entry->name, "submodule.") != 0)
2059 0 0 if (!property || (property == namestart))
0 0 if (!property || (property == namestart))
2064 0 0 if ((error = git_str_set(&name, namestart, property - namestart -1)) < 0)
2068 0 0 if (isvalid <= 0) {
2079 0 0 if (git_strmap_exists(map, name.ptr)) {
2084 0 0 if ((error = submodule_alloc(&sm, data->repo, name.ptr)) < 0)
2087 0 0 if ((error = submodule_read_config(sm, data->mods)) < 0) {
2092 0 0 if ((error = git_strmap_set(map, sm->name, sm)) < 0)
2106 0 0 if (git_repository_workdir_path(&path, sm->repo, sm->path) < 0)
2109 0 0 if (git_fs_path_isdir(path.ptr))
2112 0 0 if (git_fs_path_contains(&path, DOT_GIT))
2130 0 0 if (git_repository_workdir(repo) == NULL)
2133 0 0 if ((error = git_repository_workdir_path(&path, repo, GIT_MODULES_FILE)) < 0)
2136 0 0 if ((error = git_config_open_ondisk(&mods, path.ptr)) < 0)
2140 0 0 if ((error = git_config_snapshot(snap, mods)) < 0)
2146 0 0 if (mods)
2160 0 0 if (git_repository_workdir(repo) != NULL) {
2161 0 0 if (git_repository_workdir_path(&path, repo, GIT_MODULES_FILE) != 0)
2164 0 0 if (okay_to_create || git_fs_path_isfile(path.ptr)) {
0 0 if (okay_to_create || git_fs_path_isfile(path.ptr)) {
2166 0 0 if (git_config_backend_from_file(&mods, path.ptr) < 0)
2169 0 0 else if (git_config_backend_open(mods, GIT_CONFIG_LEVEL_LOCAL, repo) < 0) {
2189 0 0 if ((error = git_repository_head(&head, repo)) < 0)
2197 0 0 if (!git_reference_is_branch(head)) {
2205 0 0 if ((error = git_branch__upstream_name(
2212 0 0 if ((error = git_branch__remote_name(remote_name, repo, upstream_name.ptr)) < 0)
2229 0 0 if (!(error = lookup_head_remote_key(&remote_name, repo)))
2243 0 0 if (error == GIT_ENOTFOUND || error == GIT_EUNBORNBRANCH)
0 0 if (error == GIT_ENOTFOUND || error == GIT_EUNBORNBRANCH)
2246 0 0 if (error == GIT_ENOTFOUND)
2261 0 0 if ((error = lookup_default_remote(&remote, repo)) == 0) {
2264 0 0 } else if (error != GIT_ENOTFOUND)
2270 0 0 if (git_repository_is_worktree(repo)) {
2271 0 0 if ((error = git_worktree_open_from_repository(&wt, repo)) < 0)
2292 0 0 if (!head_oid) {
2293 0 0 if (index_oid)
2296 0 0 else if (!index_oid)
2298 0 0 else if (!git_oid_equal(head_oid, index_oid))
2311 0 0 (sm->flags & GIT_SUBMODULE_STATUS__WD_OID_VALID) ? &sm->wd_oid : NULL;
2319 0 0 if (!index_oid) {
2320 0 0 if (wd_oid)
2323 0 0 else if (!wd_oid) {
2324 0 0 if ((sm->flags & GIT_SUBMODULE_STATUS__WD_SCANNED) != 0 &&
0 0 if ((sm->flags & GIT_SUBMODULE_STATUS__WD_SCANNED) != 0 &&
2330 0 0 else if (!git_oid_equal(index_oid, wd_oid))
2334 0 0 if (!sm_repo)
2342 0 0 if (ign == GIT_SUBMODULE_IGNORE_NONE)
2348 0 0 if (git_repository_head_tree(&sm_head, sm_repo) < 0)
2352 0 0 if (git_diff_tree_to_index(&diff, sm_repo, sm_head, index, &opt) < 0)
2355 0 0 if (git_diff_num_deltas(diff) > 0)
2365 0 0 if (git_diff_index_to_workdir(&diff, sm_repo, index, &opt) < 0)
2371 0 0 if (untracked > 0)
2374 0 0 if (git_diff_num_deltas(diff) != untracked)