Branch Coverage

deps/libgit2/src/submodule.c
Criterion Covered Total %
branch 0 742 0.0


line true false branch
96 0 0 if (!error)
99 0 0 git_error_set(GIT_ERROR_SUBMODULE, (error == GIT_ENOTFOUND) ?
113 0 0 if (!strcmp(entry->value, data->path)) {
118 0 0 GIT_ERROR_CHECK_ALLOC(data->name);
135 0 0 if ((error = git_repository_index__weakptr(&index, repo)) < 0)
138 0 0 if ((error = git_index_find(NULL, index, path)) != GIT_ENOTFOUND) {
139 0 0 if (!error) {
147 0 0 if ((error = git_buf_sets(&dir, path)) < 0)
150 0 0 if ((error = git_path_to_dir(&dir)) < 0)
153 0 0 if ((error = git_index_find_prefix(NULL, index, dir.ptr)) != GIT_ENOTFOUND) {
154 0 0 if (!error) {
177 0 0 if (names == NULL)
180 0 0 git_strmap_foreach(names, key, value, {
205 0 0 if ((error = git_strmap_new(&names)) < 0)
208 0 0 if ((error = git_config_iterator_glob_new(&iter, cfg, key)) < 0)
211 0 0 while ((error = git_config_next(&entry, iter)) == 0) {
216 0 0 if (git_strmap_exists(names, entry->value)) {
226 0 0 if (isvalid < 0) {
230 0 0 if (!isvalid)
233 0 0 if ((error = git_strmap_set(names, git__strdup(entry->value), git_buf_detach(&buf))) < 0) {
239 0 0 if (error == GIT_ITEROVER)
261 0 0 assert(repo && name);
0 0 assert(repo && name);
263 0 0 if (repo->is_bare) {
268 0 0 if (repo->submodule_cache != NULL) {
269 0 0 if ((sm = git_strmap_get(repo->submodule_cache, name)) != NULL) {
270 0 0 if (out) {
278 0 0 if ((error = submodule_alloc(&sm, repo, name)) < 0)
281 0 0 if ((error = git_submodule_reload(sm, false)) < 0) {
286 0 0 if ((error = git_submodule_location(&location, sm)) < 0) {
292 0 0 if (location == 0 || location == GIT_SUBMODULE_STATUS_IN_WD) {
0 0 if (location == 0 || location == GIT_SUBMODULE_STATUS_IN_WD) {
299 0 0 while (path.ptr[path.size-1] == '/') {
306 0 0 if (mods)
311 0 0 if (error < 0) {
317 0 0 if (data.name) {
323 0 0 if ((error = git_submodule_reload(sm, false)) < 0) {
332 0 0 if ((error = git_submodule_location(&location, sm)) < 0) {
338 0 0 if (location == 0 || location == GIT_SUBMODULE_STATUS_IN_WD) {
0 0 if (location == 0 || location == GIT_SUBMODULE_STATUS_IN_WD) {
343 0 0 if (git_repository_workdir(repo)) {
345 0 0 if (git_buf_join3(&path,
349 0 0 if (git_path_exists(path.ptr))
359 0 0 if (out)
372 0 0 if (flags == 0)
376 0 0 if (strchr(name, '\\') != NULL) {
377 0 0 if ((error = git_path_normalize_slashes(&buf, name)) < 0)
399 0 0 if ((sm = git_strmap_get(map, name)) != NULL)
403 0 0 if ((error = submodule_alloc(&sm, repo, name)) < 0)
406 0 0 if ((error = git_strmap_set(map, sm->name, sm)) < 0) {
424 0 0 if ((error = load_submodule_names(&names, git_index_owner(idx), cfg)))
427 0 0 if ((error = git_iterator_for_index(&i, git_index_owner(idx), idx, NULL)) < 0)
430 0 0 while (!(error = git_iterator_advance(&entry, i))) {
433 0 0 if ((sm = git_strmap_get(map, entry->path)) != NULL) {
434 0 0 if (S_ISGITLINK(entry->mode))
438 0 0 } else if (S_ISGITLINK(entry->mode)) {
441 0 0 if ((name = git_strmap_get(names, entry->path)) == NULL)
444 0 0 if (!submodule_get_or_create(&sm, git_index_owner(idx), map, name)) {
451 0 0 if (error == GIT_ITEROVER)
468 0 0 if ((error = load_submodule_names(&names, git_tree_owner(head), cfg)))
471 0 0 if ((error = git_iterator_for_tree(&i, head, NULL)) < 0)
474 0 0 while (!(error = git_iterator_advance(&entry, i))) {
477 0 0 if ((sm = git_strmap_get(map, entry->path)) != NULL) {
478 0 0 if (S_ISGITLINK(entry->mode))
482 0 0 } else if (S_ISGITLINK(entry->mode)) {
485 0 0 if ((name = git_strmap_get(names, entry->path)) == NULL)
488 0 0 if (!submodule_get_or_create(&sm, git_tree_owner(head), map, name)) {
496 0 0 if (error == GIT_ITEROVER)
523 0 0 assert(repo && map);
0 0 assert(repo && map);
526 0 0 if (git_repository_index(&idx, repo) < 0)
528 0 0 if (git_repository_head_tree(&head, repo) < 0)
532 0 0 if (wd && (error = git_buf_joinpath(&path, wd, GIT_MODULES_FILE)) < 0)
0 0 if (wd && (error = git_buf_joinpath(&path, wd, GIT_MODULES_FILE)) < 0)
536 0 0 if (wd) {
541 0 0 if ((error = gitmodules_snapshot(&mods, repo)) < 0) {
542 0 0 if (error == GIT_ENOTFOUND)
548 0 0 if ((error = git_config_foreach(
553 0 0 if (mods && idx) {
0 0 if (mods && idx) {
554 0 0 if ((error = submodules_from_index(map, idx, mods)) < 0)
558 0 0 if (mods && head) {
0 0 if (mods && head) {
559 0 0 if ((error = submodules_from_head(map, head, mods)) < 0)
563 0 0 if (wd) {
564 0 0 git_strmap_foreach_value(map, sm, {
589 0 0 if (repo->is_bare) {
594 0 0 if ((error = git_strmap_new(&submodules)) < 0)
597 0 0 if ((error = git_submodule__map(repo, submodules)) < 0)
600 0 0 if (!(error = git_vector_init(
603 0 0 git_strmap_foreach_value(submodules, sm, {
0 0 git_strmap_foreach_value(submodules, sm, {
610 0 0 if (error < 0)
615 0 0 git_vector_foreach(&snapshot, i, sm) {
616 0 0 if ((error = callback(sm, sm->name, payload)) != 0) {
623 0 0 git_vector_foreach(&snapshot, i, sm)
627 0 0 git_strmap_foreach_value(submodules, sm, {
648 0 0 if (error < 0)
661 0 0 if (use_gitlink) {
663 0 0 if (error < 0)
666 0 0 if (error < 0)
701 0 0 assert(repo && url && path);
0 0 assert(repo && url && path);
0 0 assert(repo && url && path);
705 0 0 if (git_submodule_lookup(NULL, repo, path) < 0)
715 0 0 if (git__prefixcmp(path, git_repository_workdir(repo)) == 0)
718 0 0 if (git_path_root(path) >= 0) {
724 0 0 if ((error = is_path_occupied(&path_occupied, repo, path)) < 0)
727 0 0 if (path_occupied) {
734 0 0 if (!(mods = open_gitmodules(repo, GITMODULES_CREATE))) {
740 0 0 if ((error = git_buf_printf(&name, "submodule.%s.path", path)) < 0 ||
0 0 if ((error = git_buf_printf(&name, "submodule.%s.path", path)) < 0 ||
744 0 0 if ((error = submodule_config_key_trunc_puts(&name, "url")) < 0 ||
0 0 if ((error = submodule_config_key_trunc_puts(&name, "url")) < 0 ||
753 0 0 if (error < 0)
763 0 0 if ((error = git_submodule_resolve_url(&real_url, repo, url)) < 0)
766 0 0 if ((error = submodule_repo_init(&subrepo, repo, path, real_url.ptr, use_gitlink)) < 0)
770 0 0 if ((error = git_submodule_lookup(&sm, repo, path)) < 0)
776 0 0 if (error && sm) {
0 0 if (error && sm) {
780 0 0 if (out != NULL)
802 0 0 assert(out && sm);
0 0 assert(out && sm);
805 0 0 if ((error = git_buf_printf(&buf, "submodule.%s.url", sm->name)) < 0 ||
0 0 if ((error = git_buf_printf(&buf, "submodule.%s.url", sm->name)) < 0 ||
806 0 0 (error = git_repository_config_snapshot(&cfg, sm->repo)) < 0 ||
807 0 0 (error = git_config_get_string(&configured_url, cfg, buf.ptr)) < 0 ||
843 0 0 assert(submodule);
845 0 0 if (given_opts)
848 0 0 GIT_ERROR_CHECK_VERSION(&sub_opts, GIT_SUBMODULE_UPDATE_OPTIONS_VERSION, "git_submodule_update_options");
860 0 0 GIT_ERROR_CHECK_ALLOC_BUF(&rel_path);
863 0 0 if (error < 0)
866 0 0 if (!out)
882 0 0 assert(sm);
884 0 0 if ((error = git_repository_index__weakptr(&index, sm->repo)) < 0 ||
0 0 if ((error = git_repository_index__weakptr(&index, sm->repo)) < 0 ||
901 0 0 assert(sm);
906 0 0 if ((error = git_repository_index__weakptr(&index, sm->repo)) < 0 ||
0 0 if ((error = git_repository_index__weakptr(&index, sm->repo)) < 0 ||
908 0 0 &path, git_repository_workdir(sm->repo), sm->path)) < 0 ||
913 0 0 if (p_stat(path.ptr, &st) < 0) {
926 0 0 if ((sm->flags & GIT_SUBMODULE_STATUS__WD_OID_VALID) == 0) {
934 0 0 if ((error = git_commit_lookup(&head, sm_repo, &sm->wd_oid)) < 0)
948 0 0 if (!error && write_index) {
0 0 if (!error && write_index) {
951 0 0 if (!error)
964 0 0 for (i = 0; i < (int)ARRAY_SIZE(_sm_update_map); ++i)
965 0 0 if (_sm_update_map[i].map_value == (int)update)
972 0 0 assert(submodule);
978 0 0 assert(submodule);
984 0 0 assert(submodule);
990 0 0 assert(submodule);
999 0 0 assert(out && repo && url);
0 0 assert(out && repo && url);
0 0 assert(out && repo && url);
1004 0 0 if (strchr(url, '\\')) {
1005 0 0 if ((error = git_path_normalize_slashes(&normalized, url)) < 0)
1012 0 0 if (git_path_is_relative(url)) {
1013 0 0 if (!(error = get_url_base(out, repo)))
1015 0 0 } else if (strchr(url, ':') != NULL || url[0] == '/') {
0 0 } else if (strchr(url, ':') != NULL || url[0] == '/') {
1033 0 0 if (!mods)
1036 0 0 if ((error = git_buf_printf(&key, "submodule.%s.%s", name, var)) < 0)
1039 0 0 if (val)
1056 0 0 if (git_config_lookup_map_enum(&type, &val, maps, nmaps, ival) < 0) {
1061 0 0 if (type == GIT_CONFIGMAP_TRUE)
1069 0 0 assert(submodule);
1076 0 0 assert(repo && name);
0 0 assert(repo && name);
1083 0 0 assert(repo && name && url);
0 0 assert(repo && name && url);
0 0 assert(repo && name && url);
1090 0 0 assert(submodule);
1092 0 0 if (submodule->flags & GIT_SUBMODULE_STATUS__INDEX_OID_VALID)
1100 0 0 assert(submodule);
1102 0 0 if (submodule->flags & GIT_SUBMODULE_STATUS__HEAD_OID_VALID)
1110 0 0 assert(submodule);
1113 0 0 if (!(submodule->flags & GIT_SUBMODULE_STATUS__WD_OID_VALID)) {
1117 0 0 if (!git_submodule_open_bare(&subrepo, submodule))
1123 0 0 if (submodule->flags & GIT_SUBMODULE_STATUS__WD_OID_VALID)
1131 0 0 assert(submodule);
1138 0 0 assert(repo && name);
0 0 assert(repo && name);
1145 0 0 assert(submodule);
1146 0 0 return (submodule->update < GIT_SUBMODULE_UPDATE_CHECKOUT) ?
1152 0 0 assert(repo && name);
0 0 assert(repo && name);
1160 0 0 assert(submodule);
1166 0 0 assert(repo && name);
0 0 assert(repo && name);
1189 0 0 if (error < 0)
1200 0 0 if (error < 0)
1203 0 0 if (error < 0)
1238 0 0 GIT_INIT_STRUCTURE_FROM_TEMPLATE(
1263 0 0 assert(sm);
1265 0 0 if (_update_options)
1268 0 0 GIT_ERROR_CHECK_VERSION(&update_options, GIT_SUBMODULE_UPDATE_OPTIONS_VERSION, "git_submodule_update_options");
1274 0 0 if ((error = git_submodule_status(&submodule_status, sm->repo, sm->name, GIT_SUBMODULE_IGNORE_UNSPECIFIED)) < 0)
1281 0 0 if (submodule_status & GIT_SUBMODULE_STATUS_WD_UNINITIALIZED) {
1286 0 0 if ((error = git_repository_config_snapshot(&config, sm->repo)) < 0 ||
0 0 if ((error = git_repository_config_snapshot(&config, sm->repo)) < 0 ||
1290 0 0 if ((error = git_config_get_string(&submodule_url, config, git_buf_cstr(&buf))) < 0) {
1295 0 0 if (error != GIT_ENOTFOUND)
1298 0 0 if (!init) {
1305 0 0 if ((error = git_submodule_init(sm, 0)) < 0)
1311 0 0 if ((error = git_repository_config_snapshot(&config, sm->repo)) < 0 ||
0 0 if ((error = git_repository_config_snapshot(&config, sm->repo)) < 0 ||
1327 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 ||
1339 0 0 if ((error = git_submodule_open(&sub_repo, sm)) < 0)
1342 0 0 if ((oid = git_submodule_index_id(sm)) == NULL) {
1349 0 0 if ((error = git_object_lookup(&target_commit, sub_repo, oid, GIT_OBJECT_COMMIT)) < 0) {
1351 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 ||
1352 0 0 (error = lookup_default_remote(&remote, sub_repo)) < 0 ||
1353 0 0 (error = git_remote_fetch(remote, NULL, &update_options.fetch_opts, NULL)) < 0 ||
1358 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 ||
1386 0 0 if (!sm->url) {
1392 0 0 if ((error = git_repository_config(&cfg, sm->repo)) < 0)
1397 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 ||
1398 0 0 (error = git_buf_printf(&key, "submodule.%s.url", sm->name)) < 0 ||
1406 0 0 NULL : submodule_update_to_str(sm->update);
1408 0 0 if ((error = git_buf_printf(&key, "submodule.%s.update", sm->name)) < 0 ||
1430 0 0 if (!sm->url) {
1436 0 0 if ((error = git_repository_config__weakptr(&cfg, sm->repo)) < 0 ||
0 0 if ((error = git_repository_config__weakptr(&cfg, sm->repo)) < 0 ||
1437 0 0 (error = git_buf_printf(&key, "submodule.%s.url", sm->name)) < 0 ||
1438 0 0 (error = git_submodule_resolve_url(&url, sm->repo, sm->url)) < 0 ||
1442 0 0 if (!(sm->flags & GIT_SUBMODULE_STATUS_IN_WD))
1446 0 0 if ((error = git_submodule_open(&smrepo, sm)) < 0 ||
0 0 if ((error = git_submodule_open(&smrepo, sm)) < 0 ||
1450 0 0 if (lookup_head_remote_key(&remote_name, smrepo) == 0) {
1451 0 0 if ((error = git_buf_join3(&key, '.', "remote", remote_name.ptr, "url")) < 0)
1453 0 0 } else if ((error = git_buf_sets(&key, "remote.origin.url")) < 0) {
1457 0 0 if ((error = git_config__update_entry(cfg, key.ptr, url.ptr, true, false)) < 0)
1476 0 0 assert(sm && subrepo);
0 0 assert(sm && subrepo);
1478 0 0 if (git_repository__ensure_not_bare(
1493 0 0 if (bare)
1499 0 0 if (!error) {
1503 0 0 if (!git_reference_name_to_id(&sm->wd_oid, *subrepo, GIT_HEAD_FILE))
1507 0 0 } else if (git_path_exists(path.ptr)) {
1513 0 0 if (git_path_isdir(path.ptr))
1537 0 0 if (!S_ISGITLINK(ie->mode)) {
1538 0 0 if (!already_found)
1541 0 0 if (already_found)
1556 0 0 if (git_repository_index__weakptr(&index, sm->repo) < 0)
1563 0 0 if (!(ie = git_index_get_bypath(index, sm->path, 0)))
1574 0 0 if (!S_ISGITLINK(mode))
1612 0 0 assert(sm);
1614 0 0 if ((error = git_submodule_name_is_valid(sm->repo, sm->name, 0)) <= 0)
1618 0 0 if (git_repository_is_bare(sm->repo))
1622 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)
1625 0 0 if (mods != NULL && (error = submodule_read_config(sm, mods)) < 0)
0 0 if (mods != NULL && (error = submodule_read_config(sm, mods)) < 0)
1634 0 0 if ((error = submodule_load_from_wd_lite(sm)) < 0 ||
0 0 if ((error = submodule_load_from_wd_lite(sm)) < 0 ||
1647 0 0 if (tgt) {
1648 0 0 if (valid)
1666 0 0 if (ign == GIT_SUBMODULE_IGNORE_UNSPECIFIED)
1670 0 0 if (ign == GIT_SUBMODULE_IGNORE_ALL) {
1682 0 0 if (sm->repo->submodule_cache == NULL) {
1684 0 0 if (submodule_update_index(sm) < 0)
1688 0 0 if (submodule_update_head(sm) < 0)
1693 0 0 if (ign == GIT_SUBMODULE_IGNORE_DIRTY) {
1695 0 0 if (git_submodule_open_bare(&smrepo, sm) < 0)
1700 0 0 } else if (git_submodule_open(&smrepo, sm) < 0) {
1729 0 0 assert(status && repo && name);
0 0 assert(status && repo && name);
0 0 assert(status && repo && name);
1731 0 0 if ((error = git_submodule_lookup(&sm, repo, name)) < 0)
1742 0 0 assert(location && sm);
0 0 assert(location && sm);
1758 0 0 if (!name || !(namelen = strlen(name))) {
0 0 if (!name || !(namelen = strlen(name))) {
1764 0 0 GIT_ERROR_CHECK_ALLOC(sm);
1767 0 0 if (!sm->name) {
1785 0 0 if (!sm)
1788 0 0 if (sm->repo) {
1792 0 0 if (sm->path != sm->name)
1803 0 0 if (!sm)
1805 0 0 GIT_REFCOUNT_DEC(sm, submodule_release);
0 0 GIT_REFCOUNT_DEC(sm, submodule_release);
1819 0 0 if (git_config_lookup_map_value(
1833 0 0 if (git_config_lookup_map_value(
1847 0 0 if (git_config_lookup_map_value(
1863 0 0 if ((error = git_buf_printf(buf, "submodule.%s.%s", name, field)) < 0 ||
0 0 if ((error = git_buf_printf(buf, "submodule.%s.%s", name, field)) < 0 ||
1872 0 0 if (s && s[0] == '-')
0 0 if (s && s[0] == '-')
1889 0 0 if ((error = get_value(&value, cfg, &key, sm->name, "path")) == 0) {
1892 0 0 if (!looks_like_command_line_option(value)) {
1897 0 0 if (strcmp(sm->name, value) != 0) {
1898 0 0 if (sm->path != sm->name)
1901 0 0 GIT_ERROR_CHECK_ALLOC(sm->path);
1905 0 0 } else if (error != GIT_ENOTFOUND) {
1909 0 0 if ((error = get_value(&value, cfg, &key, sm->name, "url")) == 0) {
1911 0 0 if (!looks_like_command_line_option(value)) {
1914 0 0 GIT_ERROR_CHECK_ALLOC(sm->url);
1916 0 0 } else if (error != GIT_ENOTFOUND) {
1920 0 0 if ((error = get_value(&value, cfg, &key, sm->name, "branch")) == 0) {
1923 0 0 GIT_ERROR_CHECK_ALLOC(sm->branch);
1924 0 0 } else if (error != GIT_ENOTFOUND) {
1928 0 0 if ((error = get_value(&value, cfg, &key, sm->name, "update")) == 0) {
1930 0 0 if ((error = git_submodule_parse_update(&sm->update, value)) < 0)
1933 0 0 } else if (error != GIT_ENOTFOUND) {
1937 0 0 if ((error = get_value(&value, cfg, &key, sm->name, "fetchRecurseSubmodules")) == 0) {
1939 0 0 if ((error = submodule_parse_recurse(&sm->fetch_recurse, value)) < 0)
1942 0 0 } else if (error != GIT_ENOTFOUND) {
1946 0 0 if ((error = get_value(&value, cfg, &key, sm->name, "ignore")) == 0) {
1948 0 0 if ((error = git_submodule_parse_ignore(&sm->ignore, value)) < 0)
1951 0 0 } else if (error != GIT_ENOTFOUND) {
1955 0 0 if (in_config)
1974 0 0 if (git__prefixcmp(entry->name, "submodule.") != 0)
1980 0 0 if (!property || (property == namestart))
0 0 if (!property || (property == namestart))
1985 0 0 if ((error = git_buf_set(&name, namestart, property - namestart -1)) < 0)
1989 0 0 if (isvalid <= 0) {
2000 0 0 if (git_strmap_exists(map, name.ptr)) {
2005 0 0 if ((error = submodule_alloc(&sm, data->repo, name.ptr)) < 0)
2008 0 0 if ((error = submodule_read_config(sm, data->mods)) < 0) {
2013 0 0 if ((error = git_strmap_set(map, sm->name, sm)) < 0)
2027 0 0 if (git_buf_joinpath(&path, git_repository_workdir(sm->repo), sm->path) < 0)
2030 0 0 if (git_path_isdir(path.ptr))
2033 0 0 if (git_path_contains(&path, DOT_GIT))
2052 0 0 if (!workdir)
2055 0 0 if ((error = git_buf_joinpath(&path, workdir, GIT_MODULES_FILE)) < 0)
2058 0 0 if ((error = git_config_open_ondisk(&mods, path.ptr)) < 0)
2062 0 0 if ((error = git_config_snapshot(snap, mods)) < 0)
2068 0 0 if (mods)
2083 0 0 if (workdir != NULL) {
2084 0 0 if (git_buf_joinpath(&path, workdir, GIT_MODULES_FILE) != 0)
2087 0 0 if (okay_to_create || git_path_isfile(path.ptr)) {
0 0 if (okay_to_create || git_path_isfile(path.ptr)) {
2089 0 0 if (git_config_backend_from_file(&mods, path.ptr) < 0)
2092 0 0 else if (git_config_backend_open(mods, GIT_CONFIG_LEVEL_LOCAL, repo) < 0) {
2112 0 0 if ((error = git_repository_head(&head, repo)) < 0)
2120 0 0 if (!git_reference_is_branch(head)) {
2128 0 0 if ((error = git_branch_upstream_name(
2135 0 0 if ((error = git_branch_remote_name(remote_name, repo, upstream_name.ptr)) < 0)
2152 0 0 if (!(error = lookup_head_remote_key(&remote_name, repo)))
2166 0 0 if (error == GIT_ENOTFOUND || error == GIT_EUNBORNBRANCH)
0 0 if (error == GIT_ENOTFOUND || error == GIT_EUNBORNBRANCH)
2169 0 0 if (error == GIT_ENOTFOUND)
2184 0 0 if ((error = lookup_default_remote(&remote, repo)) == 0) {
2187 0 0 } else if (error != GIT_ENOTFOUND)
2193 0 0 if (git_repository_is_worktree(repo)) {
2194 0 0 if ((error = git_worktree_open_from_repository(&wt, repo)) < 0)
2214 0 0 if (!head_oid) {
2215 0 0 if (index_oid)
2218 0 0 else if (!index_oid)
2220 0 0 else if (!git_oid_equal(head_oid, index_oid))
2233 0 0 (sm->flags & GIT_SUBMODULE_STATUS__WD_OID_VALID) ? &sm->wd_oid : NULL;
2241 0 0 if (!index_oid) {
2242 0 0 if (wd_oid)
2245 0 0 else if (!wd_oid) {
2246 0 0 if ((sm->flags & GIT_SUBMODULE_STATUS__WD_SCANNED) != 0 &&
0 0 if ((sm->flags & GIT_SUBMODULE_STATUS__WD_SCANNED) != 0 &&
2252 0 0 else if (!git_oid_equal(index_oid, wd_oid))
2256 0 0 if (!sm_repo)
2264 0 0 if (ign == GIT_SUBMODULE_IGNORE_NONE)
2270 0 0 if (git_repository_head_tree(&sm_head, sm_repo) < 0)
2274 0 0 if (git_diff_tree_to_index(&diff, sm_repo, sm_head, index, &opt) < 0)
2277 0 0 if (git_diff_num_deltas(diff) > 0)
2287 0 0 if (git_diff_index_to_workdir(&diff, sm_repo, index, &opt) < 0)
2293 0 0 if (untracked > 0)
2296 0 0 if (git_diff_num_deltas(diff) != untracked)