line |
true |
false |
branch |
38
|
0 |
13 |
GIT_ERROR_CHECK_ALLOC(spec); |
40
|
0 |
13 |
if (git_refspec__parse(spec, string, is_fetch) < 0) { |
46
|
0 |
13 |
if (git_vector_insert(vector, spec) < 0) { |
66
|
0 |
10 |
if (git_buf_printf(&buf, "remote.%s.tagopt", remote->name) < 0) |
72
|
10 |
0 |
if (!error && ce && ce->value) { |
|
0 |
10 |
if (!error && ce && ce->value) { |
|
0 |
0 |
if (!error && ce && ce->value) { |
73
|
0 |
0 |
if (!strcmp(ce->value, "--no-tags")) |
75
|
0 |
0 |
else if (!strcmp(ce->value, "--tags")) |
87
|
0 |
26 |
if (!git_remote_is_valid_name(name)) { |
88
|
0 |
0 |
git_error_set( |
105
|
0 |
3 |
if ((error = git_repository_config__weakptr(&cfg, repo)) < 0) |
108
|
3 |
0 |
fmt = fetch ? CONFIG_FETCH_FMT : CONFIG_PUSH_FMT; |
110
|
0 |
3 |
if ((error = ensure_remote_name_is_valid(name)) < 0) |
113
|
0 |
3 |
if ((error = git_refspec__parse(&spec, refspec, fetch)) < 0) { |
114
|
0 |
0 |
if (git_error_last()->klass != GIT_ERROR_NOMEMORY) |
122
|
0 |
3 |
if ((error = git_buf_printf(&var, fmt, name)) < 0) |
130
|
0 |
3 |
if ((error = git_config_set_multivar(cfg, var.ptr, "$^", refspec)) < 0) { |
141
|
9 |
0 |
if (in == NULL || strlen(in) == 0) { |
|
0 |
9 |
if (in == NULL || strlen(in) == 0) { |
165
|
0 |
4 |
if (git_buf_printf(buf, "+refs/heads/*:refs/remotes/%s/*", name) < 0) |
178
|
4 |
0 |
if (error == GIT_ENOTFOUND) |
181
|
0 |
0 |
if (error < 0) |
193
|
0 |
0 |
GIT_INIT_STRUCTURE_FROM_TEMPLATE( |
213
|
5 |
0 |
assert(out && url); |
|
0 |
5 |
assert(out && url); |
215
|
0 |
5 |
if (!opts) { |
219
|
0 |
5 |
GIT_ERROR_CHECK_VERSION(opts, GIT_REMOTE_CREATE_OPTIONS_VERSION, "git_remote_create_options"); |
221
|
3 |
2 |
if (opts->name != NULL) { |
222
|
0 |
3 |
if ((error = ensure_remote_name_is_valid(opts->name)) < 0) |
225
|
3 |
0 |
if (opts->repository && |
|
0 |
3 |
if (opts->repository && |
230
|
5 |
0 |
if (opts->repository) { |
231
|
0 |
5 |
if ((error = git_repository_config_snapshot(&config_ro, opts->repository)) < 0) |
236
|
0 |
5 |
GIT_ERROR_CHECK_ALLOC(remote); |
240
|
5 |
0 |
if ((error = git_vector_init(&remote->refs, 8, NULL)) < 0 || |
|
5 |
0 |
if ((error = git_vector_init(&remote->refs, 8, NULL)) < 0 || |
244
|
5 |
0 |
if (opts->repository && !(opts->flags & GIT_REMOTE_CREATE_SKIP_INSTEADOF)) { |
|
5 |
0 |
if (opts->repository && !(opts->flags & GIT_REMOTE_CREATE_SKIP_INSTEADOF)) { |
249
|
0 |
5 |
GIT_ERROR_CHECK_ALLOC(remote->url); |
251
|
3 |
2 |
if (opts->name != NULL) { |
253
|
0 |
3 |
GIT_ERROR_CHECK_ALLOC(remote->name); |
255
|
3 |
0 |
if (opts->repository && |
|
3 |
0 |
if (opts->repository && |
256
|
3 |
0 |
((error = git_buf_printf(&var, CONFIG_URL_FMT, opts->name)) < 0 || |
257
|
3 |
0 |
(error = git_repository_config__weakptr(&config_rw, opts->repository)) < 0 || |
262
|
4 |
1 |
if (opts->fetchspec != NULL || |
|
2 |
2 |
if (opts->fetchspec != NULL || |
263
|
2 |
0 |
(opts->name && !(opts->flags & GIT_REMOTE_CREATE_SKIP_DEFAULT_FETCHSPEC))) { |
265
|
1 |
2 |
if (opts->fetchspec) { |
268
|
0 |
2 |
if ((error = default_fetchspec_for_name(&specbuf, opts->name)) < 0) |
274
|
0 |
3 |
if ((error = add_refspec(remote, fetch, true)) < 0) |
278
|
3 |
0 |
if (opts->repository && opts->name && |
|
3 |
0 |
if (opts->repository && opts->name && |
|
3 |
0 |
if (opts->repository && opts->name && |
279
|
3 |
0 |
((error = write_add_refspec(opts->repository, opts->name, fetch, true)) < 0 || |
284
|
0 |
3 |
if ((error = dwim_refspecs(&remote->active_refspecs, &remote->refspecs, &remote->refs)) < 0) |
289
|
2 |
3 |
if (!opts->name) |
301
|
0 |
5 |
if (error) |
318
|
0 |
2 |
if ((error = ensure_remote_name_is_valid(name)) < 0) |
321
|
0 |
2 |
if (canonicalize_url(&buf, url) < 0) |
341
|
0 |
1 |
if ((error = ensure_remote_name_is_valid(name)) < 0) |
372
|
0 |
0 |
GIT_ERROR_CHECK_ALLOC(remote); |
374
|
0 |
0 |
if (source->name != NULL) { |
376
|
0 |
0 |
GIT_ERROR_CHECK_ALLOC(remote->name); |
379
|
0 |
0 |
if (source->url != NULL) { |
381
|
0 |
0 |
GIT_ERROR_CHECK_ALLOC(remote->url); |
384
|
0 |
0 |
if (source->pushurl != NULL) { |
386
|
0 |
0 |
GIT_ERROR_CHECK_ALLOC(remote->pushurl); |
394
|
0 |
0 |
git_vector_init(&remote->refspecs, 2, NULL) < 0 || |
400
|
0 |
0 |
git_vector_foreach(&source->refspecs, i, spec) { |
401
|
0 |
0 |
if ((error = add_refspec(remote, spec->string, !spec->push)) < 0) |
409
|
0 |
0 |
if (error < 0) |
433
|
0 |
48 |
if (git_buf_oom(buf)) |
436
|
20 |
28 |
if (cb != NULL) |
441
|
28 |
20 |
if (found) |
444
|
25 |
23 |
if (error == GIT_ENOTFOUND) { |
462
|
14 |
0 |
assert(out && repo && name); |
|
14 |
0 |
assert(out && repo && name); |
|
0 |
14 |
assert(out && repo && name); |
464
|
0 |
14 |
if ((error = ensure_remote_name_is_valid(name)) < 0) |
467
|
0 |
14 |
if ((error = git_repository_config_snapshot(&config, repo)) < 0) |
471
|
0 |
14 |
GIT_ERROR_CHECK_ALLOC(remote); |
474
|
0 |
14 |
GIT_ERROR_CHECK_ALLOC(remote->name); |
477
|
14 |
0 |
git_vector_init(&remote->refspecs, 2, NULL) < 0 || |
478
|
0 |
14 |
git_vector_init(&remote->passive_refspecs, 2, NULL) < 0 || |
484
|
0 |
14 |
if ((error = git_buf_printf(&buf, "remote.%s.url", name)) < 0) |
487
|
0 |
14 |
if ((error = get_optional_config(&found, config, &buf, NULL, (void *)&val)) < 0) |
495
|
10 |
4 |
if (found && strlen(val) > 0) { |
|
10 |
0 |
if (found && strlen(val) > 0) { |
497
|
0 |
10 |
GIT_ERROR_CHECK_ALLOC(remote->url); |
504
|
0 |
14 |
if ((error = get_optional_config(&found, config, &buf, NULL, (void *)&val)) < 0) |
509
|
4 |
10 |
if (!optional_setting_found) { |
515
|
3 |
7 |
if (found && strlen(val) > 0) { |
|
3 |
0 |
if (found && strlen(val) > 0) { |
517
|
0 |
3 |
GIT_ERROR_CHECK_ALLOC(remote->pushurl); |
526
|
0 |
10 |
if ((error = get_optional_config(NULL, config, &buf, refspec_cb, &data)) < 0) |
533
|
0 |
10 |
if ((error = get_optional_config(NULL, config, &buf, refspec_cb, &data)) < 0) |
536
|
0 |
10 |
if ((error = download_tags_value(remote, config)) < 0) |
539
|
0 |
10 |
if ((error = lookup_remote_prune_config(remote, config, name)) < 0) |
543
|
0 |
10 |
if ((error = dwim_refspecs(&remote->active_refspecs, &remote->refspecs, &remote->refs)) < 0) |
552
|
4 |
10 |
if (error < 0) |
565
|
13 |
0 |
if ((error = git_config_get_bool(&remote->prune_refs, config, git_buf_cstr(&buf))) < 0) { |
566
|
13 |
0 |
if (error == GIT_ENOTFOUND) { |
569
|
13 |
0 |
if ((error = git_config_get_bool(&remote->prune_refs, config, "fetch.prune")) < 0) { |
570
|
13 |
0 |
if (error == GIT_ENOTFOUND) { |
584
|
0 |
6 |
assert(remote); |
590
|
0 |
2 |
assert(remote); |
596
|
0 |
2 |
assert(remote); |
606
|
2 |
0 |
assert(repo && remote); |
|
0 |
2 |
assert(repo && remote); |
608
|
0 |
2 |
if ((error = ensure_remote_name_is_valid(remote)) < 0) |
611
|
0 |
2 |
if ((error = git_repository_config__weakptr(&cfg, repo)) < 0) |
614
|
0 |
2 |
if ((error = git_buf_printf(&buf, pattern, remote)) < 0) |
617
|
2 |
0 |
if (url) { |
618
|
0 |
2 |
if ((error = canonicalize_url(&canonical_url, url)) < 0) |
640
|
0 |
1 |
assert(remote); |
653
|
2 |
0 |
if (callbacks && callbacks->resolve_url) { |
|
0 |
2 |
if (callbacks && callbacks->resolve_url) { |
656
|
0 |
0 |
if (status != GIT_PASSTHROUGH) { |
670
|
0 |
2 |
assert(remote); |
671
|
2 |
0 |
assert(direction == GIT_DIRECTION_FETCH || direction == GIT_DIRECTION_PUSH); |
|
0 |
2 |
assert(direction == GIT_DIRECTION_FETCH || direction == GIT_DIRECTION_PUSH); |
673
|
0 |
2 |
if (direction == GIT_DIRECTION_FETCH) { |
675
|
2 |
0 |
} else if (direction == GIT_DIRECTION_PUSH) { |
676
|
0 |
2 |
url = remote->pushurl ? remote->pushurl : remote->url; |
679
|
0 |
2 |
if (!url) { |
680
|
0 |
0 |
git_error_set(GIT_ERROR_INVALID, |
|
0 |
0 |
git_error_set(GIT_ERROR_INVALID, |
691
|
2 |
0 |
if (!t->set_callbacks || !cbs) |
|
0 |
2 |
if (!t->set_callbacks || !cbs) |
700
|
2 |
0 |
if (!t->set_custom_headers) |
716
|
0 |
2 |
assert(remote); |
718
|
2 |
0 |
if (callbacks) { |
719
|
0 |
2 |
GIT_ERROR_CHECK_VERSION(callbacks, GIT_REMOTE_CALLBACKS_VERSION, "git_remote_callbacks"); |
725
|
2 |
0 |
if (conn->proxy) |
726
|
0 |
2 |
GIT_ERROR_CHECK_VERSION(conn->proxy, GIT_PROXY_OPTIONS_VERSION, "git_proxy_options"); |
730
|
0 |
2 |
if ((error = git_remote__urlfordirection(&url, remote, direction, callbacks)) < 0) |
735
|
2 |
0 |
if (!t && transport && |
|
0 |
2 |
if (!t && transport && |
|
0 |
0 |
if (!t && transport && |
741
|
2 |
0 |
if (!t && (error = git_transport_new(&t, remote, url.ptr)) < 0) |
|
0 |
2 |
if (!t && (error = git_transport_new(&t, remote, url.ptr)) < 0) |
744
|
0 |
2 |
if ((error = set_transport_custom_headers(t, conn->custom_headers)) != 0) |
747
|
2 |
0 |
if ((error = set_transport_callbacks(t, callbacks)) < 0 || |
|
2 |
0 |
if ((error = set_transport_callbacks(t, callbacks)) < 0 || |
758
|
0 |
0 |
if (t) |
763
|
0 |
0 |
if (t == remote->transport) |
781
|
0 |
2 |
assert(remote); |
783
|
0 |
2 |
if (!remote->transport) { |
798
|
0 |
0 |
assert(remote); |
800
|
0 |
0 |
if (!proxy_url || !remote->repo) |
|
0 |
0 |
if (!proxy_url || !remote->repo) |
805
|
0 |
0 |
if ((error = git_repository_config__weakptr(&cfg, remote->repo)) < 0) |
812
|
0 |
0 |
if (remote->name && remote->name[0]) { |
|
0 |
0 |
if (remote->name && remote->name[0]) { |
815
|
0 |
0 |
if ((error = git_buf_printf(&buf, "remote.%s.proxy", remote->name)) < 0) |
821
|
0 |
0 |
if (error < 0) |
824
|
0 |
0 |
if (ce && ce->value) { |
|
0 |
0 |
if (ce && ce->value) { |
831
|
0 |
0 |
if ((error = git_config__lookup_entry(&ce, cfg, "http.proxy", false)) < 0) |
834
|
0 |
0 |
if (ce && ce->value) { |
|
0 |
0 |
if (ce && ce->value) { |
840
|
0 |
0 |
error = git__getenv(&val, use_ssl ? "https_proxy" : "http_proxy"); |
843
|
0 |
0 |
if (error == GIT_ENOTFOUND) |
844
|
0 |
0 |
error = git__getenv(&val, use_ssl ? "HTTPS_PROXY" : "HTTP_PROXY"); |
846
|
0 |
0 |
if (error < 0) { |
847
|
0 |
0 |
if (error == GIT_ENOTFOUND) { |
858
|
0 |
0 |
GIT_ERROR_CHECK_ALLOC(*proxy_url); |
870
|
13 |
15 |
git_vector_foreach(refspecs, i, spec) { |
871
|
0 |
13 |
if (git_refspec__dwim_one(out, spec, refs) < 0) |
883
|
12 |
38 |
git_vector_foreach(vec, i, spec) { |
904
|
0 |
0 |
if (git_remote_ls((const git_remote_head ***)&heads, &heads_len, remote) < 0) |
907
|
0 |
0 |
if (git_vector_init(out, heads_len, remote_head_cmp) < 0) |
910
|
0 |
0 |
for (i = 0; i < heads_len; i++) { |
911
|
0 |
0 |
if (git_vector_insert(out, heads[i]) < 0) |
927
|
0 |
0 |
assert(remote); |
929
|
0 |
0 |
if (!remote->repo) { |
934
|
0 |
0 |
if (opts) { |
935
|
0 |
0 |
GIT_ERROR_CHECK_VERSION(&opts->callbacks, GIT_REMOTE_CALLBACKS_VERSION, "git_remote_callbacks"); |
938
|
0 |
0 |
GIT_ERROR_CHECK_VERSION(&opts->proxy_opts, GIT_PROXY_OPTIONS_VERSION, "git_proxy_options"); |
942
|
0 |
0 |
if (!git_remote_connected(remote) && |
|
0 |
0 |
if (!git_remote_connected(remote) && |
946
|
0 |
0 |
if (ls_to_vector(&refs, remote) < 0) |
949
|
0 |
0 |
if ((git_vector_init(&specs, 0, NULL)) < 0) |
953
|
0 |
0 |
if (!refspecs || !refspecs->count) { |
|
0 |
0 |
if (!refspecs || !refspecs->count) { |
956
|
0 |
0 |
for (i = 0; i < refspecs->count; i++) { |
957
|
0 |
0 |
if ((error = add_refspec_to(&specs, refspecs->strings[i], true)) < 0) |
966
|
0 |
0 |
if ((error = dwim_refspecs(&remote->passive_refspecs, &remote->refspecs, &refs)) < 0) |
976
|
0 |
0 |
if (error < 0) |
979
|
0 |
0 |
if (remote->push) { |
984
|
0 |
0 |
if ((error = git_fetch_negotiate(remote, opts)) < 0) |
1009
|
0 |
0 |
if (opts) { |
1010
|
0 |
0 |
GIT_ERROR_CHECK_VERSION(&opts->callbacks, GIT_REMOTE_CALLBACKS_VERSION, "git_remote_callbacks"); |
1015
|
0 |
0 |
GIT_ERROR_CHECK_VERSION(&opts->proxy_opts, GIT_PROXY_OPTIONS_VERSION, "git_proxy_options"); |
1020
|
0 |
0 |
if ((error = git_remote__connect(remote, GIT_DIRECTION_FETCH, cbs, &conn)) != 0) |
1029
|
0 |
0 |
if (error != 0) |
1033
|
0 |
0 |
if (reflog_message) |
1036
|
0 |
0 |
git_buf_printf(&reflog_msg_buf, "fetch %s", |
1043
|
0 |
0 |
if (error < 0) |
1046
|
0 |
0 |
if (opts && opts->prune == GIT_FETCH_PRUNE) |
|
0 |
0 |
if (opts && opts->prune == GIT_FETCH_PRUNE) |
1048
|
0 |
0 |
else if (opts && opts->prune == GIT_FETCH_PRUNE_UNSPECIFIED && remote->prune_refs) |
|
0 |
0 |
else if (opts && opts->prune == GIT_FETCH_PRUNE_UNSPECIFIED && remote->prune_refs) |
|
0 |
0 |
else if (opts && opts->prune == GIT_FETCH_PRUNE_UNSPECIFIED && remote->prune_refs) |
1050
|
0 |
0 |
else if (opts && opts->prune == GIT_FETCH_NO_PRUNE) |
|
0 |
0 |
else if (opts && opts->prune == GIT_FETCH_NO_PRUNE) |
1055
|
0 |
0 |
if (prune) |
1066
|
0 |
0 |
assert(update_heads && fetchspec_src); |
|
0 |
0 |
assert(update_heads && fetchspec_src); |
1070
|
0 |
0 |
git_vector_foreach(update_heads, i, remote_ref) { |
1071
|
0 |
0 |
if (strcmp(remote_ref->name, fetchspec_src) == 0) { |
1090
|
0 |
0 |
!git_remote_name(remote) || |
1091
|
0 |
0 |
(error = git_branch_upstream_remote(&upstream_remote, repo, ref_name) < 0) || |
1092
|
0 |
0 |
git__strcmp(git_remote_name(remote), git_buf_cstr(&upstream_remote)) || |
1093
|
0 |
0 |
(error = git_branch_upstream_name(&upstream_name, repo, ref_name)) < 0 || |
1094
|
0 |
0 |
!git_refspec_dst_matches(spec, git_buf_cstr(&upstream_name)) || |
1097
|
0 |
0 |
if (error == GIT_ENOTFOUND) { |
1120
|
0 |
0 |
assert(out && spec && ref); |
|
0 |
0 |
assert(out && spec && ref); |
|
0 |
0 |
assert(out && spec && ref); |
1127
|
0 |
0 |
if (error == GIT_ENOTFOUND && git_reference_type(ref) == GIT_REFERENCE_SYMBOLIC) { |
|
0 |
0 |
if (error == GIT_ENOTFOUND && git_reference_type(ref) == GIT_REFERENCE_SYMBOLIC) { |
1134
|
0 |
0 |
if ((error = ref_to_update(&update, &remote_name, remote, spec, ref_name)) < 0) |
1137
|
0 |
0 |
if (update) |
1157
|
0 |
0 |
assert(remote); |
1160
|
0 |
0 |
if (update_heads->length == 0) |
1163
|
0 |
0 |
if (git_vector_init(&fetchhead_refs, update_heads->length, git_fetchhead_ref_cmp) < 0) |
1170
|
0 |
0 |
if (git_refspec_is_wildcard(spec)) { |
1171
|
0 |
0 |
if ((error = git_reference_lookup(&head_ref, remote->repo, GIT_HEAD_FILE)) < 0 || |
|
0 |
0 |
if ((error = git_reference_lookup(&head_ref, remote->repo, GIT_HEAD_FILE)) < 0 || |
1176
|
0 |
0 |
if ((error = remote_head_for_fetchspec_src(&merge_remote_ref, update_heads, git_refspec_src(spec))) < 0) |
1181
|
0 |
0 |
git_vector_foreach(update_heads, i, remote_ref) { |
1185
|
0 |
0 |
!git_refspec_src_matches(spec, remote_ref->name) && |
1189
|
0 |
0 |
if (git_fetchhead_ref_create(&fetchhead_ref, |
1196
|
0 |
0 |
if (git_vector_insert(&fetchhead_refs, fetchhead_ref) < 0) |
1203
|
0 |
0 |
for (i = 0; i < fetchhead_refs.length; ++i) |
1222
|
0 |
0 |
if ((error = git_reference_list(&arr, remote->repo)) < 0) |
1225
|
0 |
0 |
for (i = 0; i < arr.count; i++) { |
1229
|
0 |
0 |
if (!git_remote__matching_dst_refspec(remote, refname)) |
1233
|
0 |
0 |
GIT_ERROR_CHECK_ALLOC(refname_dup); |
1235
|
0 |
0 |
if ((error = git_vector_insert(candidates, refname_dup)) < 0) |
1262
|
0 |
0 |
if (callbacks) |
1263
|
0 |
0 |
GIT_ERROR_CHECK_VERSION(callbacks, GIT_REMOTE_CALLBACKS_VERSION, "git_remote_callbacks"); |
1265
|
0 |
0 |
if ((error = ls_to_vector(&remote_refs, remote)) < 0) |
1270
|
0 |
0 |
if ((error = prune_candidates(&candidates, remote)) < 0) |
1277
|
0 |
0 |
git_vector_foreach(&candidates, i, refname) { |
1278
|
0 |
0 |
git_vector_foreach(&remote->active_refspecs, j, spec) { |
1284
|
0 |
0 |
if (!git_refspec_dst_matches(spec, refname)) |
1287
|
0 |
0 |
if ((error = git_refspec_rtransform(&buf, spec, refname)) < 0) |
1294
|
0 |
0 |
if (error < 0 && error != GIT_ENOTFOUND) |
|
0 |
0 |
if (error < 0 && error != GIT_ENOTFOUND) |
1297
|
0 |
0 |
if (error == GIT_ENOTFOUND) |
1301
|
0 |
0 |
if ((error = git_vector_set((void **) &src_name, &candidates, i, NULL)) < 0) |
1315
|
0 |
0 |
git_vector_foreach(&candidates, i, refname) { |
1319
|
0 |
0 |
if (refname == NULL) |
1324
|
0 |
0 |
if (error == GIT_ENOTFOUND) |
1327
|
0 |
0 |
if (error < 0) |
1330
|
0 |
0 |
if (git_reference_type(ref) == GIT_REFERENCE_SYMBOLIC) { |
1338
|
0 |
0 |
if (error < 0) |
1341
|
0 |
0 |
if (callbacks && callbacks->update_tips) |
|
0 |
0 |
if (callbacks && callbacks->update_tips) |
1344
|
0 |
0 |
if (error < 0) |
1373
|
0 |
0 |
assert(remote); |
1375
|
0 |
0 |
if (git_repository_odb__weakptr(&odb, remote->repo) < 0) |
1378
|
0 |
0 |
if (git_refspec__parse(&tagspec, GIT_REFSPEC_TAGS, true) < 0) |
1382
|
0 |
0 |
if (git_vector_init(&update_heads, 16, NULL) < 0) |
1385
|
0 |
0 |
for (; i < refs->length; ++i) { |
1391
|
0 |
0 |
if (!git_reference_is_valid_name(head->name)) |
1395
|
0 |
0 |
if (git_refspec_src_matches(&tagspec, head->name)) { |
1396
|
0 |
0 |
if (tagopt != GIT_REMOTE_DOWNLOAD_TAGS_NONE) { |
1398
|
0 |
0 |
if (tagopt == GIT_REMOTE_DOWNLOAD_TAGS_AUTO) |
1402
|
0 |
0 |
if (git_buf_puts(&refname, head->name) < 0) |
1408
|
0 |
0 |
if (!autotag && git_refspec_src_matches(spec, head->name)) { |
|
0 |
0 |
if (!autotag && git_refspec_src_matches(spec, head->name)) { |
1409
|
0 |
0 |
if (spec->dst) { |
1410
|
0 |
0 |
if (git_refspec_transform(&refname, spec, head->name) < 0) |
1417
|
0 |
0 |
if ((error = git_vector_insert(&update_heads, head)) < 0) |
1425
|
0 |
0 |
if (git_buf_len(&refname) == 0) { |
1430
|
0 |
0 |
if (autotag && !git_odb_exists(odb, &head->oid)) |
|
0 |
0 |
if (autotag && !git_odb_exists(odb, &head->oid)) |
1433
|
0 |
0 |
if (!autotag && git_vector_insert(&update_heads, head) < 0) |
|
0 |
0 |
if (!autotag && git_vector_insert(&update_heads, head) < 0) |
1437
|
0 |
0 |
if (error < 0 && error != GIT_ENOTFOUND) |
|
0 |
0 |
if (error < 0 && error != GIT_ENOTFOUND) |
1440
|
0 |
0 |
if (error == GIT_ENOTFOUND) { |
1443
|
0 |
0 |
if (autotag && git_vector_insert(&update_heads, head) < 0) |
|
0 |
0 |
if (autotag && git_vector_insert(&update_heads, head) < 0) |
1447
|
0 |
0 |
if (!git_oid__cmp(&old, &head->oid)) |
1454
|
0 |
0 |
if (error == GIT_EEXISTS) |
1457
|
0 |
0 |
if (error < 0) |
1462
|
0 |
0 |
if (callbacks && callbacks->update_tips != NULL) { |
|
0 |
0 |
if (callbacks && callbacks->update_tips != NULL) { |
1463
|
0 |
0 |
if (callbacks->update_tips(refname.ptr, &old, &head->oid, callbacks->payload) < 0) |
1468
|
0 |
0 |
if (update_fetchhead && |
|
0 |
0 |
if (update_fetchhead && |
1508
|
0 |
0 |
for (; i < refs->length; i++) { |
1511
|
0 |
0 |
if (!git_reference_is_valid_name(head->name)) |
1514
|
0 |
0 |
for (; j < active->length; j++) { |
1517
|
0 |
0 |
if (!git_refspec_src_matches(spec, head->name)) |
1520
|
0 |
0 |
for (; k < passive->length; k++) { |
1523
|
0 |
0 |
if (!git_refspec_src_matches(passive_spec, head->name)) |
1554
|
0 |
0 |
while ((error = next_head(remote, refs, &spec, &head, &i, &j, &k)) == 0) { |
1565
|
0 |
0 |
if ((error = git_refspec_transform(&refname, spec, head->name)) < 0) |
1569
|
0 |
0 |
if (error < 0 && error != GIT_ENOTFOUND) |
|
0 |
0 |
if (error < 0 && error != GIT_ENOTFOUND) |
1572
|
0 |
0 |
if (!git_oid_cmp(&old, &head->oid)) |
1576
|
0 |
0 |
if (error) |
1581
|
0 |
0 |
if (error < 0) |
1584
|
0 |
0 |
if (callbacks && callbacks->update_tips != NULL) { |
|
0 |
0 |
if (callbacks && callbacks->update_tips != NULL) { |
1585
|
0 |
0 |
if (callbacks->update_tips(refname.ptr, &old, &head->oid, callbacks->payload) < 0) |
1590
|
0 |
0 |
if (error == GIT_ITEROVER) |
1603
|
0 |
0 |
if ((error = git_buf_joinpath(&path, gitdir, GIT_FETCH_HEAD_FILE)) < 0) |
1626
|
0 |
0 |
if (remote->push) { |
1630
|
0 |
0 |
if (git_refspec__parse(&tagspec, GIT_REFSPEC_TAGS, true) < 0) |
1634
|
0 |
0 |
if ((error = ls_to_vector(&refs, remote)) < 0) |
1637
|
0 |
0 |
if (download_tags == GIT_REMOTE_DOWNLOAD_TAGS_UNSPECIFIED) |
1642
|
0 |
0 |
if ((error = truncate_fetch_head(git_repository_path(remote->repo))) < 0) |
1645
|
0 |
0 |
if (tagopt == GIT_REMOTE_DOWNLOAD_TAGS_ALL) { |
1646
|
0 |
0 |
if ((error = update_tips_for_spec(remote, callbacks, update_fetchhead, tagopt, &tagspec, &refs, reflog_message)) < 0) |
1650
|
0 |
0 |
git_vector_foreach(&remote->active_refspecs, i, spec) { |
1651
|
0 |
0 |
if (spec->push) |
1654
|
0 |
0 |
if ((error = update_tips_for_spec(remote, callbacks, update_fetchhead, tagopt, spec, &refs, reflog_message)) < 0) |
1659
|
0 |
0 |
if (remote->passed_refspecs) |
1670
|
0 |
6 |
assert(remote); |
1672
|
4 |
2 |
if (!remote->transport || !remote->transport->is_connected) |
|
0 |
4 |
if (!remote->transport || !remote->transport->is_connected) |
1681
|
0 |
0 |
assert(remote); |
1683
|
0 |
0 |
if (remote->transport && remote->transport->cancel) |
|
0 |
0 |
if (remote->transport && remote->transport->cancel) |
1691
|
0 |
2 |
assert(remote); |
1693
|
2 |
0 |
if (git_remote_connected(remote)) |
1701
|
4 |
12 |
if (remote == NULL) |
1704
|
2 |
10 |
if (remote->transport != NULL) { |
1738
|
7 |
3 |
if (!strcmp(&name[namelen - 4], ".url")) |
1742
|
0 |
10 |
GIT_ERROR_CHECK_ALLOC(remote_name); |
1753
|
0 |
3 |
if ((error = git_repository_config__weakptr(&cfg, repo)) < 0) |
1756
|
0 |
3 |
if ((error = git_vector_init(&list, 4, git__strcmp_cb)) < 0) |
1762
|
0 |
3 |
if (error < 0) { |
1777
|
0 |
0 |
assert(remote); |
1792
|
0 |
0 |
assert(repo && remote); |
|
0 |
0 |
assert(repo && remote); |
1794
|
0 |
0 |
if ((error = ensure_remote_name_is_valid(remote)) < 0) |
1797
|
0 |
0 |
if ((error = git_repository_config__weakptr(&config, repo)) < 0) |
1800
|
0 |
0 |
if ((error = git_buf_printf(&var, CONFIG_TAGOPT_FMT, remote))) |
1812
|
0 |
0 |
if (error == GIT_ENOTFOUND) |
1838
|
0 |
2 |
if (git_buf_printf(&old_section_name, "remote.%s", old_name) < 0) |
1845
|
1 |
1 |
error = git_config_rename_section( |
1869
|
0 |
0 |
if (strcmp(entry->value, data->old_remote_name)) |
1884
|
0 |
1 |
if ((error = git_repository_config__weakptr(&data.config, repo)) < 0) |
1907
|
0 |
0 |
if ((error = git_buf_printf(&namespace, GIT_REFS_REMOTES_DIR "%s/", new_remote_name)) < 0) |
1912
|
0 |
0 |
if ((error = git_buf_puts(&new_name, git_reference_name(reference_in) + pfx_len)) < 0) |
1915
|
0 |
0 |
if ((error = git_buf_printf(&log_message, |
1920
|
0 |
0 |
if ((error = git_reference_rename(&ref, reference_in, git_buf_cstr(&new_name), 1, |
1924
|
0 |
0 |
if (git_reference_type(ref) != GIT_REFERENCE_SYMBOLIC) |
1929
|
0 |
0 |
if ((error = git_buf_printf(&old_namespace, GIT_REFS_REMOTES_DIR "%s/", old_remote_name)) < 0) |
1932
|
0 |
0 |
if (git__prefixcmp(target, old_namespace.ptr)) |
1937
|
0 |
0 |
if ((error = git_buf_puts(&new_name, target + pfx_len)) < 0) |
1965
|
0 |
1 |
if ((error = git_buf_printf(&buf, GIT_REFS_REMOTES_DIR "%s/*", old_name)) < 0) |
1971
|
0 |
1 |
if (error < 0) |
1974
|
0 |
1 |
while ((error = git_reference_next(&ref, iter)) == 0) { |
1975
|
0 |
0 |
if ((error = rename_one_remote_reference(ref, old_name, new_name)) < 0) |
1981
|
0 |
1 |
return (error == GIT_ITEROVER) ? 0 : error; |
1992
|
0 |
1 |
if ((error = git_repository_config__weakptr(&config, remote->repo)) < 0) |
1995
|
0 |
1 |
if ((error = git_vector_init(problems, 1, NULL)) < 0) |
1998
|
0 |
1 |
if ((error = default_fetchspec_for_name(&base, remote->name)) < 0) |
2001
|
1 |
1 |
git_vector_foreach(&remote->refspecs, i, spec) { |
2002
|
0 |
1 |
if (spec->push) |
2006
|
0 |
1 |
if (strcmp(git_buf_cstr(&base), spec->string)) { |
2010
|
0 |
0 |
GIT_ERROR_CHECK_ALLOC(dup); |
2012
|
0 |
0 |
if ((error = git_vector_insert(problems, dup)) < 0) |
2030
|
0 |
1 |
if ((error = git_config_set_string( |
2039
|
0 |
1 |
if (error < 0) { |
2041
|
0 |
0 |
git_vector_foreach(problems, i, str) |
2056
|
1 |
0 |
assert(out && repo && name && new_name); |
|
1 |
0 |
assert(out && repo && name && new_name); |
|
1 |
0 |
assert(out && repo && name && new_name); |
|
0 |
1 |
assert(out && repo && name && new_name); |
2058
|
0 |
1 |
if ((error = git_remote_lookup(&remote, repo, name)) < 0) |
2061
|
0 |
1 |
if ((error = ensure_remote_name_is_valid(new_name)) < 0) |
2064
|
0 |
1 |
if ((error = ensure_remote_doesnot_exist(repo, new_name)) < 0) |
2067
|
0 |
1 |
if ((error = rename_remote_config_section(repo, name, new_name)) < 0) |
2070
|
0 |
1 |
if ((error = update_branch_remote_config_entry(repo, name, new_name)) < 0) |
2073
|
0 |
1 |
if ((error = rename_remote_references(repo, name, new_name)) < 0) |
2076
|
0 |
1 |
if ((error = rename_fetch_refspecs(&problem_refspecs, remote, new_name)) < 0) |
2083
|
0 |
1 |
if (error < 0) |
2097
|
26 |
0 |
if (!remote_name || *remote_name == '\0') |
|
0 |
26 |
if (!remote_name || *remote_name == '\0') |
2115
|
0 |
0 |
git_vector_foreach(&remote->active_refspecs, i, spec) { |
2116
|
0 |
0 |
if (spec->push) |
2119
|
0 |
0 |
if (git_refspec_src_matches(spec, refname)) |
2131
|
0 |
0 |
git_vector_foreach(&remote->active_refspecs, i, spec) { |
2132
|
0 |
0 |
if (spec->push) |
2135
|
0 |
0 |
if (git_refspec_dst_matches(spec, refname)) |
2159
|
0 |
0 |
if (git_vector_init(&refspecs, remote->refspecs.length, NULL) < 0) |
2162
|
0 |
0 |
git_vector_foreach(&remote->refspecs, i, spec) { |
2163
|
0 |
0 |
if (spec->push != push) |
2166
|
0 |
0 |
if ((dup = git__strdup(spec->string)) == NULL) |
2169
|
0 |
0 |
if (git_vector_insert(&refspecs, dup) < 0) { |
2208
|
0 |
0 |
GIT_INIT_STRUCTURE_FROM_TEMPLATE( |
2222
|
0 |
0 |
assert(dot); |
2238
|
0 |
1 |
if ((error = git_repository_config__weakptr(&config, repo)) < 0) |
2241
|
0 |
1 |
if ((error = git_config_iterator_glob_new(&iter, config, "branch\\..+\\.remote")) < 0) |
2245
|
0 |
1 |
while ((error = git_config_next(&entry, iter)) == 0) { |
2249
|
0 |
0 |
if (strcmp(remote_name, entry->value)) |
2255
|
0 |
0 |
if (git_buf_printf(&buf, "branch.%.*s.merge", (int)branch_len, branch) < 0) |
2258
|
0 |
0 |
if ((error = git_config_delete_entry(config, git_buf_cstr(&buf))) < 0) { |
2259
|
0 |
0 |
if (error != GIT_ENOTFOUND) |
2265
|
0 |
0 |
if (git_buf_printf(&buf, "branch.%.*s.remote", (int)branch_len, branch) < 0) |
2268
|
0 |
0 |
if ((error = git_config_delete_entry(config, git_buf_cstr(&buf))) < 0) { |
2269
|
0 |
0 |
if (error != GIT_ENOTFOUND) |
2275
|
1 |
0 |
if (error == GIT_ITEROVER) |
2292
|
0 |
1 |
if ((error = git_vector_init(&refs, 8, NULL)) < 0) |
2295
|
0 |
1 |
if ((error = git_reference_iterator_new(&iter, repo)) < 0) |
2298
|
2 |
1 |
while ((error = git_reference_next_name(&name, iter)) == 0) { |
2299
|
2 |
0 |
if (!git_refspec_dst_matches(spec, name)) |
2303
|
0 |
0 |
if (!dup) { |
2308
|
0 |
0 |
if ((error = git_vector_insert(&refs, dup)) < 0) |
2311
|
1 |
0 |
if (error == GIT_ITEROVER) |
2313
|
0 |
1 |
if (error < 0) |
2316
|
0 |
1 |
git_vector_foreach(&refs, i, name) { |
2317
|
0 |
0 |
if ((error = git_reference_remove(repo, name)) < 0) |
2323
|
0 |
1 |
git_vector_foreach(&refs, i, dup) { |
2337
|
0 |
1 |
if ((error = git_remote_lookup(&remote, repo, remote_name)) < 0) |
2341
|
1 |
1 |
for (i = 0; i < count; i++) { |
2345
|
0 |
1 |
if (refspec == NULL) |
2348
|
0 |
1 |
if ((error = remove_refs(repo, refspec)) < 0) |
2360
|
1 |
0 |
assert(repo && name); |
|
0 |
1 |
assert(repo && name); |
2362
|
1 |
0 |
if ((error = remove_branch_config_related_entries(repo, name)) < 0 || |
|
1 |
0 |
if ((error = remove_branch_config_related_entries(repo, name)) < 0 || |
2363
|
0 |
1 |
(error = remove_remote_tracking(repo, name)) < 0 || |
2378
|
0 |
0 |
assert(out); |
2380
|
0 |
0 |
if ((error = git_remote_ls(&heads, &heads_len, remote)) < 0) |
2383
|
0 |
0 |
if (heads_len == 0) |
2386
|
0 |
0 |
if (strcmp(heads[0]->name, GIT_HEAD_FILE)) |
2391
|
0 |
0 |
if (heads[0]->symref_target) |
2401
|
0 |
0 |
for (i = 1; i < heads_len; i++) { |
2402
|
0 |
0 |
if (git_oid_cmp(head_id, &heads[i]->oid)) |
2405
|
0 |
0 |
if (git__prefixcmp(heads[i]->name, GIT_REFS_HEADS_DIR)) |
2408
|
0 |
0 |
if (!guess) { |
2413
|
0 |
0 |
if (!git__strcmp(GIT_REFS_HEADS_MASTER_FILE, heads[i]->name)) { |
2419
|
0 |
0 |
if (!guess) |
2434
|
0 |
2 |
assert(remote); |
2436
|
0 |
2 |
if (!remote->repo) { |
2441
|
2 |
0 |
if (opts) { |
2447
|
2 |
0 |
if (!git_remote_connected(remote) && |
|
0 |
2 |
if (!git_remote_connected(remote) && |
2452
|
0 |
2 |
if ((error = dwim_refspecs(&remote->active_refspecs, &remote->refspecs, &remote->refs)) < 0) |
2455
|
0 |
2 |
if (remote->push) { |
2460
|
0 |
2 |
if ((error = git_push_new(&remote->push, remote)) < 0) |
2465
|
2 |
0 |
if (opts && (error = git_push_set_options(push, opts)) < 0) |
|
0 |
2 |
if (opts && (error = git_push_set_options(push, opts)) < 0) |
2468
|
2 |
0 |
if (refspecs && refspecs->count > 0) { |
|
2 |
0 |
if (refspecs && refspecs->count > 0) { |
2469
|
2 |
2 |
for (i = 0; i < refspecs->count; i++) { |
2470
|
0 |
2 |
if ((error = git_push_add_refspec(push, refspecs->strings[i])) < 0) |
2474
|
0 |
0 |
git_vector_foreach(&remote->refspecs, i, spec) { |
2475
|
0 |
0 |
if (!spec->push) |
2477
|
0 |
0 |
if ((error = git_push_add_refspec(push, spec->string)) < 0) |
2482
|
0 |
2 |
if ((error = git_push_finish(push, cbs)) < 0) |
2485
|
2 |
0 |
if (cbs && cbs->push_update_reference && |
|
1 |
1 |
if (cbs && cbs->push_update_reference && |
|
0 |
1 |
if (cbs && cbs->push_update_reference && |
2500
|
0 |
0 |
assert(remote); |
2502
|
0 |
0 |
if (!remote->repo) { |
2507
|
0 |
0 |
if (opts) { |
2508
|
0 |
0 |
GIT_ERROR_CHECK_VERSION(&opts->callbacks, GIT_REMOTE_CALLBACKS_VERSION, "git_remote_callbacks"); |
2511
|
0 |
0 |
GIT_ERROR_CHECK_VERSION(&opts->proxy_opts, GIT_PROXY_OPTIONS_VERSION, "git_proxy_options"); |
2515
|
0 |
0 |
assert(remote); |
2517
|
0 |
0 |
if ((error = git_remote_connect(remote, GIT_DIRECTION_PUSH, cbs, proxy, custom_headers)) < 0) |
2520
|
0 |
0 |
if ((error = git_remote_upload(remote, refspecs, opts)) < 0) |
2543
|
0 |
18 |
assert(config); |
2544
|
0 |
18 |
assert(url); |
2545
|
3 |
15 |
assert(direction == GIT_DIRECTION_FETCH || direction == GIT_DIRECTION_PUSH); |
|
0 |
3 |
assert(direction == GIT_DIRECTION_FETCH || direction == GIT_DIRECTION_PUSH); |
2549
|
15 |
3 |
if (direction == GIT_DIRECTION_FETCH) { |
2557
|
0 |
18 |
if (git_config_iterator_glob_new(&iter, config, regexp) < 0) |
2561
|
0 |
18 |
while (git_config_next(&entry, iter) == 0) { |
2565
|
0 |
0 |
if (git__prefixcmp(url, entry->value)) |
2569
|
0 |
0 |
if ((n = strlen(entry->value)) <= match_length) |
2584
|
18 |
0 |
if (match_length == 0) |