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( |
1261
|
0 |
0 |
assert(sm); |
1263
|
0 |
0 |
if (_update_options) |
1266
|
0 |
0 |
GIT_ERROR_CHECK_VERSION(&update_options, GIT_SUBMODULE_UPDATE_OPTIONS_VERSION, "git_submodule_update_options"); |
1272
|
0 |
0 |
if ((error = git_submodule_status(&submodule_status, sm->repo, sm->name, GIT_SUBMODULE_IGNORE_UNSPECIFIED)) < 0) |
1279
|
0 |
0 |
if (submodule_status & GIT_SUBMODULE_STATUS_WD_UNINITIALIZED) { |
1284
|
0 |
0 |
if ((error = git_repository_config_snapshot(&config, sm->repo)) < 0 || |
|
0 |
0 |
if ((error = git_repository_config_snapshot(&config, sm->repo)) < 0 || |
1288
|
0 |
0 |
if ((error = git_config_get_string(&submodule_url, config, git_buf_cstr(&buf))) < 0) { |
1293
|
0 |
0 |
if (error != GIT_ENOTFOUND) |
1296
|
0 |
0 |
if (!init) { |
1303
|
0 |
0 |
if ((error = git_submodule_init(sm, 0)) < 0) |
1309
|
0 |
0 |
if ((error = git_repository_config_snapshot(&config, sm->repo)) < 0 || |
|
0 |
0 |
if ((error = git_repository_config_snapshot(&config, sm->repo)) < 0 || |
1325
|
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 || |
1337
|
0 |
0 |
if ((error = git_submodule_open(&sub_repo, sm)) < 0) |
1340
|
0 |
0 |
if ((oid = git_submodule_index_id(sm)) == NULL) { |
1347
|
0 |
0 |
if ((error = git_object_lookup(&target_commit, sub_repo, oid, GIT_OBJECT_COMMIT)) < 0) { |
1349
|
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 || |
1350
|
0 |
0 |
(error = lookup_default_remote(&remote, sub_repo)) < 0 || |
1351
|
0 |
0 |
(error = git_remote_fetch(remote, NULL, &update_options.fetch_opts, NULL)) < 0 || |
1356
|
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 || |
1384
|
0 |
0 |
if (!sm->url) { |
1390
|
0 |
0 |
if ((error = git_repository_config(&cfg, sm->repo)) < 0) |
1395
|
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 || |
1396
|
0 |
0 |
(error = git_buf_printf(&key, "submodule.%s.url", sm->name)) < 0 || |
1404
|
0 |
0 |
NULL : git_submodule_update_to_str(sm->update); |
1406
|
0 |
0 |
if ((error = git_buf_printf(&key, "submodule.%s.update", sm->name)) < 0 || |
1428
|
0 |
0 |
if (!sm->url) { |
1434
|
0 |
0 |
if ((error = git_repository_config__weakptr(&cfg, sm->repo)) < 0 || |
|
0 |
0 |
if ((error = git_repository_config__weakptr(&cfg, sm->repo)) < 0 || |
1435
|
0 |
0 |
(error = git_buf_printf(&key, "submodule.%s.url", sm->name)) < 0 || |
1436
|
0 |
0 |
(error = git_submodule_resolve_url(&url, sm->repo, sm->url)) < 0 || |
1440
|
0 |
0 |
if (!(sm->flags & GIT_SUBMODULE_STATUS_IN_WD)) |
1444
|
0 |
0 |
if ((error = git_submodule_open(&smrepo, sm)) < 0 || |
|
0 |
0 |
if ((error = git_submodule_open(&smrepo, sm)) < 0 || |
1448
|
0 |
0 |
if (lookup_head_remote_key(&remote_name, smrepo) == 0) { |
1449
|
0 |
0 |
if ((error = git_buf_join3(&key, '.', "remote", remote_name.ptr, "url")) < 0) |
1451
|
0 |
0 |
} else if ((error = git_buf_sets(&key, "remote.origin.url")) < 0) { |
1455
|
0 |
0 |
if ((error = git_config__update_entry(cfg, key.ptr, url.ptr, true, false)) < 0) |
1474
|
0 |
0 |
assert(sm && subrepo); |
|
0 |
0 |
assert(sm && subrepo); |
1476
|
0 |
0 |
if (git_repository__ensure_not_bare( |
1491
|
0 |
0 |
if (bare) |
1497
|
0 |
0 |
if (!error) { |
1501
|
0 |
0 |
if (!git_reference_name_to_id(&sm->wd_oid, *subrepo, GIT_HEAD_FILE)) |
1505
|
0 |
0 |
} else if (git_path_exists(path.ptr)) { |
1511
|
0 |
0 |
if (git_path_isdir(path.ptr)) |
1535
|
0 |
0 |
if (!S_ISGITLINK(ie->mode)) { |
1536
|
0 |
0 |
if (!already_found) |
1539
|
0 |
0 |
if (already_found) |
1554
|
0 |
0 |
if (git_repository_index__weakptr(&index, sm->repo) < 0) |
1561
|
0 |
0 |
if (!(ie = git_index_get_bypath(index, sm->path, 0))) |
1572
|
0 |
0 |
if (!S_ISGITLINK(mode)) |
1610
|
0 |
0 |
assert(sm); |
1612
|
0 |
0 |
if ((error = git_submodule_name_is_valid(sm->repo, sm->name, 0)) <= 0) |
1616
|
0 |
0 |
if (git_repository_is_bare(sm->repo)) |
1620
|
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) |
1623
|
0 |
0 |
if (mods != NULL && (error = submodule_read_config(sm, mods)) < 0) |
|
0 |
0 |
if (mods != NULL && (error = submodule_read_config(sm, mods)) < 0) |
1632
|
0 |
0 |
if ((error = submodule_load_from_wd_lite(sm)) < 0 || |
|
0 |
0 |
if ((error = submodule_load_from_wd_lite(sm)) < 0 || |
1645
|
0 |
0 |
if (tgt) { |
1646
|
0 |
0 |
if (valid) |
1664
|
0 |
0 |
if (ign == GIT_SUBMODULE_IGNORE_UNSPECIFIED) |
1668
|
0 |
0 |
if (ign == GIT_SUBMODULE_IGNORE_ALL) { |
1680
|
0 |
0 |
if (sm->repo->submodule_cache == NULL) { |
1682
|
0 |
0 |
if (submodule_update_index(sm) < 0) |
1686
|
0 |
0 |
if (submodule_update_head(sm) < 0) |
1691
|
0 |
0 |
if (ign == GIT_SUBMODULE_IGNORE_DIRTY) { |
1693
|
0 |
0 |
if (git_submodule_open_bare(&smrepo, sm) < 0) |
1698
|
0 |
0 |
} else if (git_submodule_open(&smrepo, sm) < 0) { |
1727
|
0 |
0 |
assert(status && repo && name); |
|
0 |
0 |
assert(status && repo && name); |
|
0 |
0 |
assert(status && repo && name); |
1729
|
0 |
0 |
if ((error = git_submodule_lookup(&sm, repo, name)) < 0) |
1740
|
0 |
0 |
assert(location && sm); |
|
0 |
0 |
assert(location && sm); |
1756
|
0 |
0 |
if (!name || !(namelen = strlen(name))) { |
|
0 |
0 |
if (!name || !(namelen = strlen(name))) { |
1762
|
0 |
0 |
GIT_ERROR_CHECK_ALLOC(sm); |
1765
|
0 |
0 |
if (!sm->name) { |
1783
|
0 |
0 |
if (!sm) |
1786
|
0 |
0 |
if (sm->repo) { |
1790
|
0 |
0 |
if (sm->path != sm->name) |
1801
|
0 |
0 |
if (!sm) |
1803
|
0 |
0 |
GIT_REFCOUNT_DEC(sm, submodule_release); |
|
0 |
0 |
GIT_REFCOUNT_DEC(sm, submodule_release); |
1817
|
0 |
0 |
if (git_config_lookup_map_value( |
1831
|
0 |
0 |
if (git_config_lookup_map_value( |
1845
|
0 |
0 |
if (git_config_lookup_map_value( |
1861
|
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 || |
1870
|
0 |
0 |
if (s && s[0] == '-') |
|
0 |
0 |
if (s && s[0] == '-') |
1887
|
0 |
0 |
if ((error = get_value(&value, cfg, &key, sm->name, "path")) == 0) { |
1890
|
0 |
0 |
if (!looks_like_command_line_option(value)) { |
1895
|
0 |
0 |
if (strcmp(sm->name, value) != 0) { |
1896
|
0 |
0 |
if (sm->path != sm->name) |
1899
|
0 |
0 |
GIT_ERROR_CHECK_ALLOC(sm->path); |
1903
|
0 |
0 |
} else if (error != GIT_ENOTFOUND) { |
1907
|
0 |
0 |
if ((error = get_value(&value, cfg, &key, sm->name, "url")) == 0) { |
1909
|
0 |
0 |
if (!looks_like_command_line_option(value)) { |
1912
|
0 |
0 |
GIT_ERROR_CHECK_ALLOC(sm->url); |
1914
|
0 |
0 |
} else if (error != GIT_ENOTFOUND) { |
1918
|
0 |
0 |
if ((error = get_value(&value, cfg, &key, sm->name, "branch")) == 0) { |
1921
|
0 |
0 |
GIT_ERROR_CHECK_ALLOC(sm->branch); |
1922
|
0 |
0 |
} else if (error != GIT_ENOTFOUND) { |
1926
|
0 |
0 |
if ((error = get_value(&value, cfg, &key, sm->name, "update")) == 0) { |
1928
|
0 |
0 |
if ((error = git_submodule_parse_update(&sm->update, value)) < 0) |
1931
|
0 |
0 |
} else if (error != GIT_ENOTFOUND) { |
1935
|
0 |
0 |
if ((error = get_value(&value, cfg, &key, sm->name, "fetchRecurseSubmodules")) == 0) { |
1937
|
0 |
0 |
if ((error = git_submodule_parse_recurse(&sm->fetch_recurse, value)) < 0) |
1940
|
0 |
0 |
} else if (error != GIT_ENOTFOUND) { |
1944
|
0 |
0 |
if ((error = get_value(&value, cfg, &key, sm->name, "ignore")) == 0) { |
1946
|
0 |
0 |
if ((error = git_submodule_parse_ignore(&sm->ignore, value)) < 0) |
1949
|
0 |
0 |
} else if (error != GIT_ENOTFOUND) { |
1953
|
0 |
0 |
if (in_config) |
1972
|
0 |
0 |
if (git__prefixcmp(entry->name, "submodule.") != 0) |
1978
|
0 |
0 |
if (!property || (property == namestart)) |
|
0 |
0 |
if (!property || (property == namestart)) |
1983
|
0 |
0 |
if ((error = git_buf_set(&name, namestart, property - namestart -1)) < 0) |
1987
|
0 |
0 |
if (isvalid <= 0) { |
1998
|
0 |
0 |
if (git_strmap_exists(map, name.ptr)) { |
2003
|
0 |
0 |
if ((error = submodule_alloc(&sm, data->repo, name.ptr)) < 0) |
2006
|
0 |
0 |
if ((error = submodule_read_config(sm, data->mods)) < 0) { |
2011
|
0 |
0 |
if ((error = git_strmap_set(map, sm->name, sm)) < 0) |
2025
|
0 |
0 |
if (git_buf_joinpath(&path, git_repository_workdir(sm->repo), sm->path) < 0) |
2028
|
0 |
0 |
if (git_path_isdir(path.ptr)) |
2031
|
0 |
0 |
if (git_path_contains(&path, DOT_GIT)) |
2050
|
0 |
0 |
if (!workdir) |
2053
|
0 |
0 |
if ((error = git_buf_joinpath(&path, workdir, GIT_MODULES_FILE)) < 0) |
2056
|
0 |
0 |
if ((error = git_config_open_ondisk(&mods, path.ptr)) < 0) |
2060
|
0 |
0 |
if ((error = git_config_snapshot(snap, mods)) < 0) |
2066
|
0 |
0 |
if (mods) |
2081
|
0 |
0 |
if (workdir != NULL) { |
2082
|
0 |
0 |
if (git_buf_joinpath(&path, workdir, GIT_MODULES_FILE) != 0) |
2085
|
0 |
0 |
if (okay_to_create || git_path_isfile(path.ptr)) { |
|
0 |
0 |
if (okay_to_create || git_path_isfile(path.ptr)) { |
2087
|
0 |
0 |
if (git_config_backend_from_file(&mods, path.ptr) < 0) |
2090
|
0 |
0 |
else if (git_config_backend_open(mods, GIT_CONFIG_LEVEL_LOCAL, repo) < 0) { |
2110
|
0 |
0 |
if ((error = git_repository_head(&head, repo)) < 0) |
2118
|
0 |
0 |
if (!git_reference_is_branch(head)) { |
2126
|
0 |
0 |
if ((error = git_branch_upstream_name( |
2133
|
0 |
0 |
if ((error = git_branch_remote_name(remote_name, repo, upstream_name.ptr)) < 0) |
2150
|
0 |
0 |
if (!(error = lookup_head_remote_key(&remote_name, repo))) |
2164
|
0 |
0 |
if (error == GIT_ENOTFOUND || error == GIT_EUNBORNBRANCH) |
|
0 |
0 |
if (error == GIT_ENOTFOUND || error == GIT_EUNBORNBRANCH) |
2167
|
0 |
0 |
if (error == GIT_ENOTFOUND) |
2182
|
0 |
0 |
if ((error = lookup_default_remote(&remote, repo)) == 0) { |
2185
|
0 |
0 |
} else if (error != GIT_ENOTFOUND) |
2191
|
0 |
0 |
if (git_repository_is_worktree(repo)) { |
2192
|
0 |
0 |
if ((error = git_worktree_open_from_repository(&wt, repo)) < 0) |
2212
|
0 |
0 |
if (!head_oid) { |
2213
|
0 |
0 |
if (index_oid) |
2216
|
0 |
0 |
else if (!index_oid) |
2218
|
0 |
0 |
else if (!git_oid_equal(head_oid, index_oid)) |
2231
|
0 |
0 |
(sm->flags & GIT_SUBMODULE_STATUS__WD_OID_VALID) ? &sm->wd_oid : NULL; |
2239
|
0 |
0 |
if (!index_oid) { |
2240
|
0 |
0 |
if (wd_oid) |
2243
|
0 |
0 |
else if (!wd_oid) { |
2244
|
0 |
0 |
if ((sm->flags & GIT_SUBMODULE_STATUS__WD_SCANNED) != 0 && |
|
0 |
0 |
if ((sm->flags & GIT_SUBMODULE_STATUS__WD_SCANNED) != 0 && |
2250
|
0 |
0 |
else if (!git_oid_equal(index_oid, wd_oid)) |
2254
|
0 |
0 |
if (!sm_repo) |
2262
|
0 |
0 |
if (ign == GIT_SUBMODULE_IGNORE_NONE) |
2268
|
0 |
0 |
if (git_repository_head_tree(&sm_head, sm_repo) < 0) |
2272
|
0 |
0 |
if (git_diff_tree_to_index(&diff, sm_repo, sm_head, index, &opt) < 0) |
2275
|
0 |
0 |
if (git_diff_num_deltas(diff) > 0) |
2285
|
0 |
0 |
if (git_diff_index_to_workdir(&diff, sm_repo, index, &opt) < 0) |
2291
|
0 |
0 |
if (untracked > 0) |
2294
|
0 |
0 |
if (git_diff_num_deltas(diff) != untracked) |