line |
true |
false |
branch |
83
|
0 |
334 |
if (!backend->gitpath) |
94
|
334 |
0 |
if (error <= 0) { |
95
|
334 |
0 |
if (error == GIT_ENOTFOUND) { |
112
|
0 |
0 |
if (*scan == '#') { |
115
|
0 |
0 |
if (git__prefixcmp(scan, traits_header) == 0) { |
119
|
0 |
0 |
if (!eol) |
123
|
0 |
0 |
if (strstr(scan, " fully-peeled ") != NULL) { |
125
|
0 |
0 |
} else if (strstr(scan, " peeled ") != NULL) { |
133
|
0 |
0 |
while (scan < eof && *scan == '#') { |
|
0 |
0 |
while (scan < eof && *scan == '#') { |
134
|
0 |
0 |
if (!(eol = strchr(scan, '\n'))) |
139
|
0 |
0 |
while (scan < eof) { |
145
|
0 |
0 |
if (git_oid_fromstr(&oid, scan) < 0) |
149
|
0 |
0 |
if (*scan++ != ' ') |
151
|
0 |
0 |
if (!(eol = strchr(scan, '\n'))) |
154
|
0 |
0 |
if (eol[-1] == '\r') |
157
|
0 |
0 |
if (git_sortedcache_upsert((void **)&ref, backend->refcache, scan) < 0) |
165
|
0 |
0 |
if (*scan == '^') { |
166
|
0 |
0 |
if (git_oid_fromstr(&oid, scan + 1) < 0) |
170
|
0 |
0 |
if (scan < eof) { |
171
|
0 |
0 |
if (!(eol = strchr(scan, '\n'))) |
179
|
0 |
0 |
else if (backend->peeling_mode == PEELING_FULL || |
|
0 |
0 |
else if (backend->peeling_mode == PEELING_FULL || |
180
|
0 |
0 |
(backend->peeling_mode == PEELING_STANDARD && |
205
|
0 |
801 |
if (git_buf_len(file_content) < GIT_OID_HEXSZ) |
209
|
0 |
801 |
if (git_oid_fromstr(oid, str) < 0) |
214
|
801 |
0 |
if (*str == '\0' || git__isspace(*str)) |
|
801 |
0 |
if (*str == '\0' || git__isspace(*str)) |
227
|
1451 |
0 |
if ((error = git_buf_joinpath(buf, base, path)) < 0 || |
|
166 |
1285 |
if ((error = git_buf_joinpath(buf, base, path)) < 0 || |
244
|
0 |
0 |
if (loose_readbuffer(&ref_file, backend->gitpath, name) < 0) { |
250
|
0 |
0 |
if (!git__prefixcmp(git_buf_cstr(&ref_file), GIT_SYMREF)) |
254
|
0 |
0 |
if ((error = loose_parse_oid(&oid, name, &ref_file)) < 0) |
259
|
0 |
0 |
if (!(error = git_sortedcache_upsert( |
278
|
0 |
0 |
if (git__suffixcmp(full_path->ptr, ".lock") == 0) |
281
|
0 |
0 |
if (git_path_isdir(full_path->ptr)) { |
285
|
0 |
0 |
if (error == GIT_ENOTFOUND) { |
309
|
0 |
0 |
if (git_buf_joinpath(&refs_path, backend->gitpath, GIT_REFS_DIR) < 0) |
334
|
0 |
30 |
assert(backend); |
338
|
0 |
30 |
if ((error = git_buf_joinpath(&ref_path, backend->gitpath, ref_name)) < 0) |
341
|
2 |
28 |
if (git_path_isfile(ref_path.ptr)) { |
346
|
0 |
28 |
if ((error = packed_reload(backend)) < 0) |
349
|
0 |
28 |
if (git_sortedcache_lookup(backend->refcache, ref_name) != NULL) { |
366
|
0 |
484 |
if (git_buf_len(file_content) < header_len + 1) { |
402
|
1334 |
117 |
if (out) |
405
|
530 |
921 |
if (is_per_worktree_ref(ref_name)) |
410
|
1285 |
166 |
if ((error = loose_readbuffer(&ref_file, ref_dir, ref_name)) < 0) |
412
|
484 |
801 |
else if (git__prefixcmp(git_buf_cstr(&ref_file), GIT_SYMREF) == 0) { |
417
|
0 |
484 |
if (!(target = loose_parse_symbolic(&ref_file))) |
419
|
484 |
0 |
else if (out != NULL) |
424
|
801 |
0 |
if (!(error = loose_parse_oid(&oid, ref_name, &ref_file)) && |
|
684 |
117 |
if (!(error = loose_parse_oid(&oid, ref_name, &ref_file)) && |
447
|
0 |
166 |
if ((error = packed_reload(backend)) < 0) |
450
|
0 |
166 |
if (git_sortedcache_rlock(backend->refcache) < 0) |
454
|
166 |
0 |
if (!entry) { |
458
|
0 |
0 |
if (!*out) |
475
|
0 |
1323 |
assert(backend); |
477
|
1157 |
166 |
if (!(error = loose_lookup(out, backend, ref_name))) |
482
|
166 |
0 |
if (error == GIT_ENOTFOUND) { |
523
|
0 |
32 |
if (!backend->commonpath) /* do nothing if no commonpath for loose refs */ |
528
|
3 |
29 |
if (iter->glob) { |
531
|
59 |
0 |
for (pos = iter->glob; *pos; ++pos) { |
546
|
3 |
0 |
if (last_sep) { |
552
|
32 |
0 |
if ((error = git_buf_printf(&path, "%s/", backend->commonpath)) < 0 || |
|
0 |
32 |
if ((error = git_buf_printf(&path, "%s/", backend->commonpath)) < 0 || |
558
|
2 |
30 |
if ((error = git_iterator_for_filesystem(&fsit, path.ptr, &fsit_opts)) < 0) { |
560
|
2 |
0 |
return (iter->glob && error == GIT_ENOTFOUND)? 0 : error; |
|
0 |
2 |
return (iter->glob && error == GIT_ENOTFOUND)? 0 : error; |
565
|
158 |
0 |
while (!error && !git_iterator_advance(&entry, fsit)) { |
|
128 |
30 |
while (!error && !git_iterator_advance(&entry, fsit)) { |
573
|
128 |
0 |
if (git__suffixcmp(ref_name, ".lock") == 0 || |
|
1 |
127 |
if (git__suffixcmp(ref_name, ".lock") == 0 || |
574
|
0 |
1 |
(iter->glob && wildmatch(iter->glob, ref_name, 0) != 0)) |
578
|
0 |
128 |
if (!ref_dup) |
598
|
11 |
8 |
while (iter->loose_pos < iter->loose.length) { |
601
|
11 |
0 |
if (loose_lookup(out, backend, path) == 0) { |
603
|
0 |
11 |
if (ref) |
613
|
0 |
8 |
while (iter->packed_pos < git_sortedcache_entrycount(iter->cache)) { |
615
|
0 |
0 |
if (!ref) /* stop now if another thread deleted refs and we past end */ |
618
|
0 |
0 |
if (ref->flags & PACKREF_SHADOWED) |
620
|
0 |
0 |
if (iter->glob && wildmatch(iter->glob, ref->name, 0) != 0) |
|
0 |
0 |
if (iter->glob && wildmatch(iter->glob, ref->name, 0) != 0) |
624
|
0 |
0 |
error = (*out != NULL) ? 0 : -1; |
639
|
117 |
23 |
while (iter->loose_pos < iter->loose.length) { |
643
|
117 |
0 |
if (loose_lookup(NULL, backend, path) == 0) { |
645
|
0 |
117 |
if (ref) |
656
|
0 |
23 |
while (iter->packed_pos < git_sortedcache_entrycount(iter->cache)) { |
658
|
0 |
0 |
if (!ref) /* stop now if another thread deleted refs and we past end */ |
661
|
0 |
0 |
if (ref->flags & PACKREF_SHADOWED) |
663
|
0 |
0 |
if (iter->glob && wildmatch(iter->glob, ref->name, 0) != 0) |
|
0 |
0 |
if (iter->glob && wildmatch(iter->glob, ref->name, 0) != 0) |
681
|
0 |
32 |
assert(backend); |
684
|
0 |
32 |
GIT_ERROR_CHECK_ALLOC(iter); |
686
|
0 |
32 |
if ((error = git_pool_init(&iter->pool, 1)) < 0) |
689
|
0 |
32 |
if ((error = git_vector_init(&iter->loose, 8, NULL)) < 0) |
698
|
0 |
32 |
if ((error = iter_load_loose_paths(backend, iter)) < 0) |
701
|
0 |
32 |
if ((error = packed_reload(backend)) < 0) |
704
|
0 |
32 |
if ((error = git_sortedcache_copy(&iter->cache, backend->refcache, 1, NULL, NULL)) < 0) |
713
|
0 |
32 |
if (error) |
721
|
0 |
0 |
if (old_ref == NULL || strcmp(old_ref, this_ref)) { |
|
0 |
0 |
if (old_ref == NULL || strcmp(old_ref, this_ref)) { |
725
|
0 |
0 |
const char *lead = reflen < newlen ? new_ref : this_ref; |
727
|
0 |
0 |
if (!strncmp(new_ref, this_ref, cmplen) && lead[cmplen] == '/') { |
|
0 |
0 |
if (!strncmp(new_ref, this_ref, cmplen) && lead[cmplen] == '/') { |
744
|
0 |
100 |
if ((error = packed_reload(backend)) < 0) |
747
|
30 |
70 |
if (!force) { |
750
|
0 |
30 |
if ((error = refdb_fs_backend__exists( |
755
|
2 |
28 |
if (exists) { |
765
|
0 |
98 |
for (i = 0; i < git_sortedcache_entrycount(backend->refcache); ++i) { |
768
|
0 |
0 |
if (ref && !ref_is_available(old_ref, new_ref, ref->name)) { |
|
0 |
0 |
if (ref && !ref_is_available(old_ref, new_ref, ref->name)) { |
786
|
108 |
0 |
assert(file && backend && name); |
|
108 |
0 |
assert(file && backend && name); |
|
0 |
108 |
assert(file && backend && name); |
788
|
0 |
108 |
if (!git_path_isvalid(backend->repo, name, 0, GIT_PATH_REJECT_FILESYSTEM_DEFAULTS)) { |
793
|
27 |
81 |
if (is_per_worktree_ref(name)) |
801
|
0 |
108 |
if ((error = git_futils_rmdir_r(name, basedir, GIT_RMDIR_SKIP_NONEMPTY)) < 0) |
804
|
0 |
108 |
if (git_buf_joinpath(&ref_path, basedir, name) < 0) |
808
|
0 |
108 |
if (backend->fsync) |
813
|
0 |
108 |
if (error == GIT_EDIRECTORY) |
822
|
93 |
0 |
assert(file && ref); |
|
0 |
93 |
assert(file && ref); |
824
|
73 |
20 |
if (ref->type == GIT_REFERENCE_DIRECT) { |
829
|
20 |
0 |
} else if (ref->type == GIT_REFERENCE_SYMBOLIC) { |
845
|
0 |
3 |
GIT_ERROR_CHECK_ALLOC(lock); |
847
|
0 |
3 |
if ((error = loose_lock(lock, backend, refname)) < 0) { |
879
|
1 |
2 |
if (success == 2) |
881
|
2 |
0 |
else if (success) |
902
|
0 |
0 |
if (ref->flags & PACKREF_HAS_PEEL || ref->flags & PACKREF_CANNOT_PEEL) |
|
0 |
0 |
if (ref->flags & PACKREF_HAS_PEEL || ref->flags & PACKREF_CANNOT_PEEL) |
908
|
0 |
0 |
if (git_object_lookup(&object, backend->repo, &ref->oid, GIT_OBJECT_ANY) < 0) |
916
|
0 |
0 |
if (git_object_type(object) == GIT_OBJECT_TAG) { |
954
|
0 |
0 |
if (ref->flags & PACKREF_HAS_PEEL) { |
958
|
0 |
0 |
if (git_filebuf_printf(file, "%s %s\n^%s\n", oid, ref->name, peel) < 0) |
961
|
0 |
0 |
if (git_filebuf_printf(file, "%s %s\n", oid, ref->name) < 0) |
988
|
0 |
0 |
for (i = 0; i < git_sortedcache_entrycount(backend->refcache); ++i) { |
992
|
0 |
0 |
if (!ref || !(ref->flags & PACKREF_WAS_LOOSE)) |
|
0 |
0 |
if (!ref || !(ref->flags & PACKREF_WAS_LOOSE)) |
1000
|
0 |
0 |
if (error == GIT_EEXISTS || error == GIT_ENOTFOUND) |
|
0 |
0 |
if (error == GIT_EEXISTS || error == GIT_ENOTFOUND) |
1003
|
0 |
0 |
if (error < 0) { |
1011
|
0 |
0 |
if (error == GIT_ENOTFOUND) |
1015
|
0 |
0 |
if (!git__prefixcmp(ref_content.ptr, GIT_SYMREF)) |
1019
|
0 |
0 |
if (loose_parse_oid(¤t_id, lock.path_original, &ref_content) < 0) |
1023
|
0 |
0 |
if (!git_oid_equal(¤t_id, &ref->oid)) |
1051
|
0 |
0 |
if ((error = git_sortedcache_wlock(refcache)) < 0) |
1054
|
0 |
0 |
if (backend->fsync) |
1058
|
0 |
0 |
if ((error = git_filebuf_open(&pack_file, git_sortedcache_path(refcache), open_flags, GIT_PACKEDREFS_FILE_MODE)) < 0) |
1064
|
0 |
0 |
if ((error = git_filebuf_printf(&pack_file, "%s\n", GIT_PACKEDREFS_HEADER)) < 0) |
1067
|
0 |
0 |
for (i = 0; i < git_sortedcache_entrycount(refcache); ++i) { |
1069
|
0 |
0 |
assert(ref); |
1071
|
0 |
0 |
if ((error = packed_find_peel(backend, ref)) < 0) |
1074
|
0 |
0 |
if ((error = packed_write_ref(ref, &pack_file)) < 0) |
1080
|
0 |
0 |
if ((error = git_filebuf_commit(&pack_file)) < 0) |
1085
|
0 |
0 |
if ((error = packed_remove_loose(backend)) < 0) |
1106
|
0 |
8 |
if ((error = packed_reload(backend)) < 0) |
1109
|
0 |
8 |
if ((error = git_sortedcache_wlock(backend->refcache)) < 0) |
1114
|
0 |
8 |
if (error == 0) { |
1118
|
8 |
0 |
if (error == GIT_ENOTFOUND) |
1123
|
0 |
8 |
if (found) |
1140
|
93 |
113 |
if (!old_id && !old_target) |
|
69 |
24 |
if (!old_id && !old_target) |
1143
|
31 |
106 |
if ((error = refdb_fs_backend__lookup(&old_ref, backend, name)) < 0) |
1147
|
84 |
22 |
if (old_id && old_ref->type != GIT_REFERENCE_DIRECT) { |
|
2 |
82 |
if (old_id && old_ref->type != GIT_REFERENCE_DIRECT) { |
1151
|
22 |
82 |
if (old_target && old_ref->type != GIT_REFERENCE_SYMBOLIC) { |
|
1 |
21 |
if (old_target && old_ref->type != GIT_REFERENCE_SYMBOLIC) { |
1156
|
82 |
21 |
if (old_id && old_ref->type == GIT_REFERENCE_DIRECT) |
|
82 |
0 |
if (old_id && old_ref->type == GIT_REFERENCE_DIRECT) |
1159
|
21 |
82 |
if (old_target && old_ref->type == GIT_REFERENCE_SYMBOLIC) |
|
21 |
0 |
if (old_target && old_ref->type == GIT_REFERENCE_SYMBOLIC) |
1189
|
80 |
0 |
if ((error = git_repository_refdb(&refdb, backend->repo)) < 0 || |
|
80 |
0 |
if ((error = git_repository_refdb(&refdb, backend->repo)) < 0 || |
1192
|
50 |
30 |
if (!write_reflog) |
1196
|
3 |
27 |
if (git_reference_name_to_id(&old_id, backend->repo, ref->name) < 0) |
1199
|
30 |
0 |
if ((error = git_reference_lookup(&head, backend->repo, GIT_HEAD_FILE)) < 0 || |
1222
|
0 |
99 |
assert(backend); |
1224
|
2 |
97 |
if ((error = reference_path_available(backend, ref->name, NULL, force)) < 0) |
1228
|
0 |
97 |
if ((error = loose_lock(&file, backend, ref->name)) < 0) |
1249
|
0 |
99 |
if ((error = cmp_old_ref(&cmp, _backend, ref->name, old_id, old_target)) < 0) |
1252
|
0 |
99 |
if (cmp) { |
1258
|
22 |
77 |
if (ref->type == GIT_REFERENCE_SYMBOLIC) |
1264
|
31 |
68 |
if (error < 0 && error != GIT_ENOTFOUND) |
|
0 |
31 |
if (error < 0 && error != GIT_ENOTFOUND) |
1268
|
68 |
31 |
if (!error && !cmp) { |
|
7 |
61 |
if (!error && !cmp) { |
1273
|
90 |
2 |
if (update_reflog) { |
1276
|
90 |
0 |
if ((error = git_repository_refdb__weakptr(&refdb, backend->repo)) < 0 || |
|
90 |
0 |
if ((error = git_repository_refdb__weakptr(&refdb, backend->repo)) < 0 || |
1280
|
80 |
10 |
if (should_write) { |
1281
|
0 |
80 |
if ((error = reflog_append(backend, ref, NULL, NULL, who, message)) < 0) |
1283
|
0 |
80 |
if ((error = maybe_append_head(backend, ref, who, message)) < 0) |
1304
|
11 |
0 |
assert(backend && ref_name); |
|
0 |
11 |
assert(backend && ref_name); |
1306
|
0 |
11 |
if (git_buf_sets(&relative_path, ref_name) < 0) |
1310
|
6 |
5 |
if ((commonlen = git_path_common_dirlen("refs/heads/", git_buf_cstr(&relative_path))) == strlen("refs/heads/") || |
|
4 |
2 |
if ((commonlen = git_path_common_dirlen("refs/heads/", git_buf_cstr(&relative_path))) == strlen("refs/heads/") || |
1311
|
0 |
4 |
(commonlen = git_path_common_dirlen("refs/tags/", git_buf_cstr(&relative_path))) == strlen("refs/tags/") || |
1316
|
7 |
0 |
if (prefix) { |
1317
|
0 |
7 |
if (git_buf_join3(&base_path, '/', backend->commonpath, prefix, git_buf_cstr(&relative_path)) < 0) |
1320
|
0 |
0 |
if (git_buf_joinpath(&base_path, backend->commonpath, git_buf_cstr(&relative_path)) < 0) |
1341
|
7 |
0 |
assert(backend && ref_name); |
|
0 |
7 |
assert(backend && ref_name); |
1343
|
0 |
7 |
if ((error = loose_lock(&file, backend, ref_name)) < 0) |
1346
|
0 |
7 |
if ((error = refdb_reflog_fs__delete(_backend, ref_name)) < 0) { |
1359
|
0 |
8 |
if (git_buf_joinpath(&loose_path, backend->commonpath, ref_name) < 0) |
1363
|
0 |
8 |
if (error < 0 && errno == ENOENT) |
|
0 |
0 |
if (error < 0 && errno == ENOENT) |
1365
|
0 |
8 |
else if (error != 0) |
1384
|
0 |
8 |
if (error < 0) |
1387
|
0 |
8 |
if (cmp) { |
1410
|
0 |
8 |
if ((error = packed_delete(backend, ref_name)) < 0 && error != GIT_ENOTFOUND) |
|
0 |
0 |
if ((error = packed_delete(backend, ref_name)) < 0 && error != GIT_ENOTFOUND) |
1413
|
8 |
0 |
if (error == 0) |
1416
|
0 |
8 |
if ((error = loose_delete(backend, ref_name)) < 0 && error != GIT_ENOTFOUND) |
|
0 |
0 |
if ((error = loose_delete(backend, ref_name)) < 0 && error != GIT_ENOTFOUND) |
1419
|
0 |
8 |
if (error == GIT_ENOTFOUND) { |
1420
|
0 |
0 |
error = packed_deleted ? 0 : ref_error_notfound(ref_name); |
1426
|
8 |
0 |
if (error == 0) |
1447
|
0 |
1 |
assert(backend); |
1449
|
1 |
0 |
if ((error = reference_path_available( |
1450
|
0 |
1 |
backend, new_name, old_name, force)) < 0 || |
1454
|
0 |
1 |
if ((error = refdb_fs_backend__delete(_backend, old_name, NULL, NULL)) < 0) { |
1460
|
0 |
1 |
if (!new) { |
1465
|
0 |
1 |
if ((error = loose_lock(&file, backend, new->name)) < 0) { |
1472
|
1 |
0 |
if (((error == 0) || (error == GIT_ENOTFOUND)) && |
|
1 |
0 |
if (((error == 0) || (error == GIT_ENOTFOUND)) && |
|
0 |
1 |
if (((error == 0) || (error == GIT_ENOTFOUND)) && |
1479
|
0 |
1 |
if (error < 0) { |
1486
|
1 |
0 |
if ((error = loose_commit(&file, new)) < 0 || out == NULL) { |
|
0 |
1 |
if ((error = loose_commit(&file, new)) < 0 || out == NULL) { |
1500
|
0 |
0 |
assert(backend); |
1502
|
0 |
0 |
if ((error = packed_reload(backend)) < 0 || /* load the existing packfile */ |
|
0 |
0 |
if ((error = packed_reload(backend)) < 0 || /* load the existing packfile */ |
1503
|
0 |
0 |
(error = packed_loadloose(backend)) < 0 || /* add all the loose refs */ |
1514
|
0 |
49 |
assert(backend); |
1527
|
0 |
108 |
if (!in) |
1533
|
108 |
0 |
if (repo->namespace == NULL) { |
1539
|
0 |
0 |
if (parts == NULL) |
1548
|
0 |
0 |
while ((start = git__strsep(&end, "/")) != NULL) |
1555
|
0 |
0 |
if (git_futils_mkdir_relative(git_buf_cstr(&path), in, 0777, |
1575
|
0 |
20 |
GIT_ERROR_CHECK_ALLOC(log); |
1578
|
0 |
20 |
GIT_ERROR_CHECK_ALLOC(log->ref_name); |
1580
|
0 |
20 |
if (git_vector_init(&log->entries, 0, NULL) < 0) { |
1595
|
0 |
20 |
if ((git_parse_ctx_init(&parser, buf, buf_size)) < 0) |
1598
|
39 |
20 |
for (; parser.remain_len; git_parse_advance_line(&parser)) { |
1604
|
0 |
39 |
GIT_ERROR_CHECK_ALLOC(entry); |
1606
|
0 |
39 |
GIT_ERROR_CHECK_ALLOC(entry->committer); |
1609
|
39 |
0 |
git_parse_advance_expected(&parser, " ", 1) < 0 || |
1614
|
2145 |
0 |
while (git_parse_peek(&c, &parser, 0) == 0 && c != '\t' && c != '\n') |
|
2106 |
39 |
while (git_parse_peek(&c, &parser, 0) == 0 && c != '\t' && c != '\n') |
|
2106 |
0 |
while (git_parse_peek(&c, &parser, 0) == 0 && c != '\t' && c != '\n') |
1617
|
0 |
39 |
if (git_signature__parse(entry->committer, &sig, parser.line, NULL, 0) < 0) |
1620
|
39 |
0 |
if (c == '\t') { |
1625
|
39 |
0 |
if (parser.line[len - 1] == '\n') |
1629
|
0 |
39 |
GIT_ERROR_CHECK_ALLOC(entry->msg); |
1632
|
0 |
39 |
if ((git_vector_insert(&log->entries, entry)) < 0) { |
1650
|
0 |
7 |
if ((error = git_futils_mkpath2file(filepath, GIT_REFLOG_DIR_MODE)) < 0) |
1653
|
0 |
7 |
if ((fd = p_open(filepath, |
1663
|
77 |
163 |
if (strcmp(name, GIT_HEAD_FILE) == 0) |
1675
|
6 |
0 |
assert(_backend && name); |
|
0 |
6 |
assert(_backend && name); |
1680
|
0 |
6 |
if ((error = retrieve_reflog_path(&path, repo, name)) < 0) |
1694
|
0 |
88 |
if (retrieve_reflog_path(&path, repo, name) < 0) |
1708
|
88 |
0 |
assert(_backend && name); |
|
0 |
88 |
assert(_backend && name); |
1724
|
20 |
0 |
assert(out && _backend && name); |
|
20 |
0 |
assert(out && _backend && name); |
|
0 |
20 |
assert(out && _backend && name); |
1729
|
0 |
20 |
if (reflog_alloc(&log, name) < 0) |
1732
|
0 |
20 |
if (retrieve_reflog_path(&log_path, repo, name) < 0) |
1736
|
1 |
19 |
if (error < 0 && error != GIT_ENOTFOUND) |
|
0 |
1 |
if (error < 0 && error != GIT_ENOTFOUND) |
1739
|
1 |
19 |
if ((error == GIT_ENOTFOUND) && |
|
0 |
1 |
if ((error == GIT_ENOTFOUND) && |
1743
|
0 |
20 |
if ((error = reflog_parse(log, |
1784
|
114 |
7 |
if (msg) { |
1790
|
19193 |
114 |
for (i = 0; i < buf->size - 2; i++) |
1791
|
0 |
19193 |
if (buf->ptr[i] == '\n') |
1809
|
0 |
7 |
if (!git_path_isvalid(backend->repo, refname, 0, GIT_PATH_REJECT_FILESYSTEM_DEFAULTS)) { |
1814
|
0 |
7 |
if (retrieve_reflog_path(&log_path, repo, refname) < 0) |
1817
|
0 |
7 |
if (!git_path_isfile(git_buf_cstr(&log_path))) { |
1841
|
7 |
0 |
assert(_backend && reflog); |
|
0 |
7 |
assert(_backend && reflog); |
1845
|
0 |
7 |
if ((error = lock_reflog(&fbuf, backend, reflog->ref_name)) < 0) |
1848
|
10 |
7 |
git_vector_foreach(&reflog->entries, i, entry) { |
1849
|
0 |
10 |
if (serialize_reflog_entry(&log, &(entry->oid_old), &(entry->oid_cur), entry->committer, entry->msg) < 0) |
1852
|
0 |
10 |
if ((error = git_filebuf_write(&fbuf, log.ptr, log.size)) < 0) |
1879
|
48 |
63 |
if (is_symbolic && |
|
0 |
48 |
if (is_symbolic && |
1880
|
0 |
0 |
strcmp(ref->name, GIT_HEAD_FILE) && |
1881
|
0 |
0 |
!(old && new)) |
1886
|
31 |
80 |
if (old) { |
1890
|
23 |
57 |
if (error < 0 && error != GIT_ENOTFOUND) |
|
0 |
23 |
if (error < 0 && error != GIT_ENOTFOUND) |
1894
|
30 |
81 |
if (new) { |
1897
|
63 |
18 |
if (!is_symbolic) { |
1901
|
0 |
18 |
if (error < 0 && error != GIT_ENOTFOUND) |
|
0 |
0 |
if (error < 0 && error != GIT_ENOTFOUND) |
1904
|
0 |
18 |
if (error == GIT_ENOTFOUND) |
1911
|
0 |
111 |
if ((error = serialize_reflog_entry(&buf, &old_id, &new_id, who, message)) < 0) |
1914
|
0 |
111 |
if ((error = retrieve_reflog_path(&path, repo, ref->name)) < 0) |
1917
|
0 |
111 |
if (((error = git_futils_mkpath2file(git_buf_cstr(&path), 0777)) < 0) && |
|
0 |
0 |
if (((error = git_futils_mkpath2file(git_buf_cstr(&path), 0777)) < 0) && |
1925
|
0 |
111 |
if (git_path_isdir(git_buf_cstr(&path))) { |
1926
|
0 |
0 |
if ((error = git_futils_rmdir_r(git_buf_cstr(&path), NULL, GIT_RMDIR_SKIP_NONEMPTY)) < 0) { |
1927
|
0 |
0 |
if (error == GIT_ENOTFOUND) |
1929
|
0 |
0 |
} else if (git_path_isdir(git_buf_cstr(&path))) { |
1935
|
0 |
0 |
if (error != 0) |
1941
|
0 |
111 |
if (backend->fsync) |
1963
|
1 |
0 |
assert(_backend && old_name && new_name); |
|
1 |
0 |
assert(_backend && old_name && new_name); |
|
0 |
1 |
assert(_backend && old_name && new_name); |
1968
|
0 |
1 |
if ((error = git_reference__normalize_name( |
1972
|
0 |
1 |
if (git_buf_joinpath(&temp_path, repo->gitdir, GIT_REFLOG_DIR) < 0) |
1975
|
0 |
1 |
if (git_buf_joinpath(&old_path, git_buf_cstr(&temp_path), old_name) < 0) |
1978
|
0 |
1 |
if (git_buf_joinpath(&new_path, git_buf_cstr(&temp_path), git_buf_cstr(&normalized)) < 0) |
1981
|
1 |
0 |
if (!git_path_exists(git_buf_cstr(&old_path))) { |
1993
|
0 |
0 |
if (git_buf_joinpath(&temp_path, git_buf_cstr(&temp_path), "temp_reflog") < 0) |
1996
|
0 |
0 |
if ((fd = git_futils_mktmp(&temp_path, git_buf_cstr(&temp_path), GIT_REFLOG_FILE_MODE)) < 0) { |
2003
|
0 |
0 |
if (p_rename(git_buf_cstr(&old_path), git_buf_cstr(&temp_path)) < 0) { |
2015
|
0 |
0 |
if (git_futils_mkpath2file(git_buf_cstr(&new_path), GIT_REFLOG_DIR_MODE) < 0) { |
2020
|
0 |
0 |
if (p_rename(git_buf_cstr(&temp_path), git_buf_cstr(&new_path)) < 0) { |
2040
|
8 |
0 |
assert(_backend && name); |
|
0 |
8 |
assert(_backend && name); |
2042
|
0 |
8 |
if ((error = retrieve_reflog_path(&path, backend->repo, name)) < 0) |
2045
|
5 |
3 |
if (!git_path_exists(path.ptr)) |
2048
|
0 |
3 |
if ((error = p_unlink(path.ptr)) < 0) |
2068
|
0 |
54 |
GIT_ERROR_CHECK_ALLOC(backend); |
2070
|
0 |
54 |
if (git_refdb_init_backend(&backend->parent, GIT_REFDB_BACKEND_VERSION) < 0) |
2075
|
54 |
0 |
if (repository->gitdir) { |
2078
|
0 |
54 |
if (backend->gitpath == NULL) |
2082
|
54 |
0 |
if (repository->commondir) { |
2085
|
0 |
54 |
if (backend->commonpath == NULL) |
2097
|
54 |
0 |
if (!git_repository__configmap_lookup(&t, backend->repo, GIT_CONFIGMAP_IGNORECASE) && t) { |
|
0 |
54 |
if (!git_repository__configmap_lookup(&t, backend->repo, GIT_CONFIGMAP_IGNORECASE) && t) { |
2101
|
54 |
0 |
if (!git_repository__configmap_lookup(&t, backend->repo, GIT_CONFIGMAP_PRECOMPOSE) && t) { |
|
0 |
54 |
if (!git_repository__configmap_lookup(&t, backend->repo, GIT_CONFIGMAP_PRECOMPOSE) && t) { |
2105
|
54 |
0 |
if ((!git_repository__configmap_lookup(&t, backend->repo, GIT_CONFIGMAP_FSYNCOBJECTFILES) && t) || |
|
54 |
0 |
if ((!git_repository__configmap_lookup(&t, backend->repo, GIT_CONFIGMAP_FSYNCOBJECTFILES) && t) || |
|
0 |
54 |
if ((!git_repository__configmap_lookup(&t, backend->repo, GIT_CONFIGMAP_FSYNCOBJECTFILES) && t) || |