line |
true |
false |
branch |
83
|
0 |
354 |
if (!backend->gitpath) |
94
|
354 |
0 |
if (error <= 0) { |
95
|
354 |
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 |
814 |
if (git_buf_len(file_content) < GIT_OID_HEXSZ) |
209
|
0 |
814 |
if (git_oid_fromstr(oid, str) < 0) |
214
|
814 |
0 |
if (*str == '\0' || git__isspace(*str)) |
|
814 |
0 |
if (*str == '\0' || git__isspace(*str)) |
227
|
1496 |
0 |
if ((error = git_buf_joinpath(buf, base, path)) < 0 || |
|
186 |
1310 |
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 |
496 |
if (git_buf_len(file_content) < header_len + 1) { |
402
|
1379 |
117 |
if (out) |
405
|
545 |
951 |
if (is_per_worktree_ref(ref_name)) |
410
|
1310 |
186 |
if ((error = loose_readbuffer(&ref_file, ref_dir, ref_name)) < 0) |
412
|
496 |
814 |
else if (git__prefixcmp(git_buf_cstr(&ref_file), GIT_SYMREF) == 0) { |
417
|
0 |
496 |
if (!(target = loose_parse_symbolic(&ref_file))) |
419
|
496 |
0 |
else if (out != NULL) |
424
|
814 |
0 |
if (!(error = loose_parse_oid(&oid, ref_name, &ref_file)) && |
|
697 |
117 |
if (!(error = loose_parse_oid(&oid, ref_name, &ref_file)) && |
447
|
0 |
186 |
if ((error = packed_reload(backend)) < 0) |
450
|
0 |
186 |
if (git_sortedcache_rlock(backend->refcache) < 0) |
454
|
186 |
0 |
if (!entry) { |
458
|
0 |
0 |
if (!*out) |
475
|
0 |
1368 |
assert(backend); |
477
|
1182 |
186 |
if (!(error = loose_lookup(out, backend, ref_name))) |
482
|
186 |
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); |
688
|
0 |
32 |
if ((error = git_vector_init(&iter->loose, 8, NULL)) < 0) |
697
|
0 |
32 |
if ((error = iter_load_loose_paths(backend, iter)) < 0) |
700
|
0 |
32 |
if ((error = packed_reload(backend)) < 0) |
703
|
0 |
32 |
if ((error = git_sortedcache_copy(&iter->cache, backend->refcache, 1, NULL, NULL)) < 0) |
712
|
0 |
32 |
if (error) |
720
|
0 |
0 |
if (old_ref == NULL || strcmp(old_ref, this_ref)) { |
|
0 |
0 |
if (old_ref == NULL || strcmp(old_ref, this_ref)) { |
724
|
0 |
0 |
const char *lead = reflen < newlen ? new_ref : this_ref; |
726
|
0 |
0 |
if (!strncmp(new_ref, this_ref, cmplen) && lead[cmplen] == '/') { |
|
0 |
0 |
if (!strncmp(new_ref, this_ref, cmplen) && lead[cmplen] == '/') { |
743
|
0 |
100 |
if ((error = packed_reload(backend)) < 0) |
746
|
30 |
70 |
if (!force) { |
749
|
0 |
30 |
if ((error = refdb_fs_backend__exists( |
754
|
2 |
28 |
if (exists) { |
764
|
0 |
98 |
for (i = 0; i < git_sortedcache_entrycount(backend->refcache); ++i) { |
767
|
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)) { |
785
|
108 |
0 |
assert(file && backend && name); |
|
108 |
0 |
assert(file && backend && name); |
|
0 |
108 |
assert(file && backend && name); |
787
|
0 |
108 |
if (!git_path_isvalid(backend->repo, name, 0, GIT_PATH_REJECT_FILESYSTEM_DEFAULTS)) { |
792
|
27 |
81 |
if (is_per_worktree_ref(name)) |
800
|
0 |
108 |
if ((error = git_futils_rmdir_r(name, basedir, GIT_RMDIR_SKIP_NONEMPTY)) < 0) |
803
|
0 |
108 |
if (git_buf_joinpath(&ref_path, basedir, name) < 0) |
807
|
0 |
108 |
if (backend->fsync) |
812
|
0 |
108 |
if (error == GIT_EDIRECTORY) |
821
|
93 |
0 |
assert(file && ref); |
|
0 |
93 |
assert(file && ref); |
823
|
73 |
20 |
if (ref->type == GIT_REFERENCE_DIRECT) { |
828
|
20 |
0 |
} else if (ref->type == GIT_REFERENCE_SYMBOLIC) { |
844
|
0 |
3 |
GIT_ERROR_CHECK_ALLOC(lock); |
846
|
0 |
3 |
if ((error = loose_lock(lock, backend, refname)) < 0) { |
878
|
1 |
2 |
if (success == 2) |
880
|
2 |
0 |
else if (success) |
901
|
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) |
907
|
0 |
0 |
if (git_object_lookup(&object, backend->repo, &ref->oid, GIT_OBJECT_ANY) < 0) |
915
|
0 |
0 |
if (git_object_type(object) == GIT_OBJECT_TAG) { |
953
|
0 |
0 |
if (ref->flags & PACKREF_HAS_PEEL) { |
957
|
0 |
0 |
if (git_filebuf_printf(file, "%s %s\n^%s\n", oid, ref->name, peel) < 0) |
960
|
0 |
0 |
if (git_filebuf_printf(file, "%s %s\n", oid, ref->name) < 0) |
987
|
0 |
0 |
for (i = 0; i < git_sortedcache_entrycount(backend->refcache); ++i) { |
991
|
0 |
0 |
if (!ref || !(ref->flags & PACKREF_WAS_LOOSE)) |
|
0 |
0 |
if (!ref || !(ref->flags & PACKREF_WAS_LOOSE)) |
999
|
0 |
0 |
if (error == GIT_EEXISTS || error == GIT_ENOTFOUND) |
|
0 |
0 |
if (error == GIT_EEXISTS || error == GIT_ENOTFOUND) |
1002
|
0 |
0 |
if (error < 0) { |
1010
|
0 |
0 |
if (error == GIT_ENOTFOUND) |
1014
|
0 |
0 |
if (!git__prefixcmp(ref_content.ptr, GIT_SYMREF)) |
1018
|
0 |
0 |
if (loose_parse_oid(¤t_id, lock.path_original, &ref_content) < 0) |
1022
|
0 |
0 |
if (!git_oid_equal(¤t_id, &ref->oid)) |
1050
|
0 |
0 |
if ((error = git_sortedcache_wlock(refcache)) < 0) |
1053
|
0 |
0 |
if (backend->fsync) |
1057
|
0 |
0 |
if ((error = git_filebuf_open(&pack_file, git_sortedcache_path(refcache), open_flags, GIT_PACKEDREFS_FILE_MODE)) < 0) |
1063
|
0 |
0 |
if ((error = git_filebuf_printf(&pack_file, "%s\n", GIT_PACKEDREFS_HEADER)) < 0) |
1066
|
0 |
0 |
for (i = 0; i < git_sortedcache_entrycount(refcache); ++i) { |
1068
|
0 |
0 |
assert(ref); |
1070
|
0 |
0 |
if ((error = packed_find_peel(backend, ref)) < 0) |
1073
|
0 |
0 |
if ((error = packed_write_ref(ref, &pack_file)) < 0) |
1079
|
0 |
0 |
if ((error = git_filebuf_commit(&pack_file)) < 0) |
1084
|
0 |
0 |
if ((error = packed_remove_loose(backend)) < 0) |
1105
|
0 |
8 |
if ((error = packed_reload(backend)) < 0) |
1108
|
0 |
8 |
if ((error = git_sortedcache_wlock(backend->refcache)) < 0) |
1113
|
0 |
8 |
if (error == 0) { |
1117
|
8 |
0 |
if (error == GIT_ENOTFOUND) |
1122
|
0 |
8 |
if (found) |
1137
|
0 |
90 |
if (error < 0) |
1141
|
2 |
88 |
if (logall == GIT_LOGALLREFUPDATES_UNSET) |
1154
|
10 |
19 |
*write = has_reflog(repo, name) || |
1155
|
10 |
0 |
!git__prefixcmp(name, GIT_REFS_HEADS_DIR) || |
1156
|
10 |
0 |
!git__strcmp(name, GIT_HEAD_FILE) || |
1157
|
29 |
59 |
!git__prefixcmp(name, GIT_REFS_REMOTES_DIR) || |
|
2 |
8 |
!git__prefixcmp(name, GIT_REFS_REMOTES_DIR) || |
1177
|
93 |
113 |
if (!old_id && !old_target) |
|
69 |
24 |
if (!old_id && !old_target) |
1180
|
31 |
106 |
if ((error = refdb_fs_backend__lookup(&old_ref, backend, name)) < 0) |
1184
|
84 |
22 |
if (old_id && old_ref->type != GIT_REFERENCE_DIRECT) { |
|
2 |
82 |
if (old_id && old_ref->type != GIT_REFERENCE_DIRECT) { |
1188
|
22 |
82 |
if (old_target && old_ref->type != GIT_REFERENCE_SYMBOLIC) { |
|
1 |
21 |
if (old_target && old_ref->type != GIT_REFERENCE_SYMBOLIC) { |
1193
|
82 |
21 |
if (old_id && old_ref->type == GIT_REFERENCE_DIRECT) |
|
82 |
0 |
if (old_id && old_ref->type == GIT_REFERENCE_DIRECT) |
1196
|
21 |
82 |
if (old_target && old_ref->type == GIT_REFERENCE_SYMBOLIC) |
|
21 |
0 |
if (old_target && old_ref->type == GIT_REFERENCE_SYMBOLIC) |
1226
|
18 |
62 |
if (ref->type == GIT_REFERENCE_SYMBOLIC) |
1230
|
23 |
39 |
if (git_reference_name_to_id(&old_id, backend->repo, ref->name) < 0) |
1233
|
0 |
62 |
if ((error = git_reference_lookup(&head, backend->repo, GIT_HEAD_FILE)) < 0) |
1236
|
4 |
58 |
if (git_reference_type(head) == GIT_REFERENCE_DIRECT) |
1239
|
0 |
58 |
if ((error = git_reference_lookup(&tmp, backend->repo, GIT_HEAD_FILE)) < 0) |
1243
|
58 |
55 |
while (git_reference_type(tmp) == GIT_REFERENCE_SYMBOLIC) { |
1245
|
3 |
55 |
if (error < 0) |
1252
|
3 |
55 |
if (error == GIT_ENOTFOUND) { |
1255
|
0 |
55 |
} else if (error < 0) { |
1261
|
28 |
30 |
if (strcmp(name, ref->name)) |
1285
|
0 |
99 |
assert(backend); |
1287
|
2 |
97 |
if ((error = reference_path_available(backend, ref->name, NULL, force)) < 0) |
1291
|
0 |
97 |
if ((error = loose_lock(&file, backend, ref->name)) < 0) |
1312
|
0 |
99 |
if ((error = cmp_old_ref(&cmp, _backend, ref->name, old_id, old_target)) < 0) |
1315
|
0 |
99 |
if (cmp) { |
1321
|
22 |
77 |
if (ref->type == GIT_REFERENCE_SYMBOLIC) |
1327
|
31 |
68 |
if (error < 0 && error != GIT_ENOTFOUND) |
|
0 |
31 |
if (error < 0 && error != GIT_ENOTFOUND) |
1331
|
68 |
31 |
if (!error && !cmp) { |
|
7 |
61 |
if (!error && !cmp) { |
1336
|
90 |
2 |
if (update_reflog) { |
1337
|
0 |
90 |
if ((error = should_write_reflog(&should_write, backend->repo, ref->name)) < 0) |
1340
|
80 |
10 |
if (should_write) { |
1341
|
0 |
80 |
if ((error = reflog_append(backend, ref, NULL, NULL, who, message)) < 0) |
1343
|
0 |
80 |
if ((error = maybe_append_head(backend, ref, who, message)) < 0) |
1364
|
11 |
0 |
assert(backend && ref_name); |
|
0 |
11 |
assert(backend && ref_name); |
1366
|
0 |
11 |
if (git_buf_sets(&relative_path, ref_name) < 0) |
1370
|
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/") || |
1371
|
0 |
4 |
(commonlen = git_path_common_dirlen("refs/tags/", git_buf_cstr(&relative_path))) == strlen("refs/tags/") || |
1376
|
7 |
0 |
if (prefix) { |
1377
|
0 |
7 |
if (git_buf_join3(&base_path, '/', backend->commonpath, prefix, git_buf_cstr(&relative_path)) < 0) |
1380
|
0 |
0 |
if (git_buf_joinpath(&base_path, backend->commonpath, git_buf_cstr(&relative_path)) < 0) |
1401
|
7 |
0 |
assert(backend && ref_name); |
|
0 |
7 |
assert(backend && ref_name); |
1403
|
0 |
7 |
if ((error = loose_lock(&file, backend, ref_name)) < 0) |
1406
|
0 |
7 |
if ((error = refdb_reflog_fs__delete(_backend, ref_name)) < 0) { |
1419
|
0 |
8 |
if (git_buf_joinpath(&loose_path, backend->commonpath, ref_name) < 0) |
1423
|
0 |
8 |
if (error < 0 && errno == ENOENT) |
|
0 |
0 |
if (error < 0 && errno == ENOENT) |
1425
|
0 |
8 |
else if (error != 0) |
1444
|
0 |
8 |
if (error < 0) |
1447
|
0 |
8 |
if (cmp) { |
1470
|
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) |
1473
|
8 |
0 |
if (error == 0) |
1476
|
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) |
1479
|
0 |
8 |
if (error == GIT_ENOTFOUND) { |
1480
|
0 |
0 |
error = packed_deleted ? 0 : ref_error_notfound(ref_name); |
1486
|
8 |
0 |
if (error == 0) |
1507
|
0 |
1 |
assert(backend); |
1509
|
1 |
0 |
if ((error = reference_path_available( |
1510
|
0 |
1 |
backend, new_name, old_name, force)) < 0 || |
1514
|
0 |
1 |
if ((error = refdb_fs_backend__delete(_backend, old_name, NULL, NULL)) < 0) { |
1520
|
0 |
1 |
if (!new) { |
1525
|
0 |
1 |
if ((error = loose_lock(&file, backend, new->name)) < 0) { |
1532
|
1 |
0 |
if (((error == 0) || (error == GIT_ENOTFOUND)) && |
|
1 |
0 |
if (((error == 0) || (error == GIT_ENOTFOUND)) && |
|
0 |
1 |
if (((error == 0) || (error == GIT_ENOTFOUND)) && |
1539
|
0 |
1 |
if (error < 0) { |
1546
|
1 |
0 |
if ((error = loose_commit(&file, new)) < 0 || out == NULL) { |
|
0 |
1 |
if ((error = loose_commit(&file, new)) < 0 || out == NULL) { |
1560
|
0 |
0 |
assert(backend); |
1562
|
0 |
0 |
if ((error = packed_reload(backend)) < 0 || /* load the existing packfile */ |
|
0 |
0 |
if ((error = packed_reload(backend)) < 0 || /* load the existing packfile */ |
1563
|
0 |
0 |
(error = packed_loadloose(backend)) < 0 || /* add all the loose refs */ |
1574
|
0 |
32 |
assert(backend); |
1587
|
0 |
70 |
if (!in) |
1593
|
70 |
0 |
if (repo->namespace == NULL) { |
1599
|
0 |
0 |
if (parts == NULL) |
1608
|
0 |
0 |
while ((start = git__strsep(&end, "/")) != NULL) |
1615
|
0 |
0 |
if (git_futils_mkdir_relative(git_buf_cstr(&path), in, 0777, |
1635
|
0 |
20 |
GIT_ERROR_CHECK_ALLOC(log); |
1638
|
0 |
20 |
GIT_ERROR_CHECK_ALLOC(log->ref_name); |
1640
|
0 |
20 |
if (git_vector_init(&log->entries, 0, NULL) < 0) { |
1655
|
0 |
20 |
if ((git_parse_ctx_init(&parser, buf, buf_size)) < 0) |
1658
|
39 |
20 |
for (; parser.remain_len; git_parse_advance_line(&parser)) { |
1664
|
0 |
39 |
GIT_ERROR_CHECK_ALLOC(entry); |
1666
|
0 |
39 |
GIT_ERROR_CHECK_ALLOC(entry->committer); |
1669
|
39 |
0 |
git_parse_advance_expected(&parser, " ", 1) < 0 || |
1674
|
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') |
1677
|
0 |
39 |
if (git_signature__parse(entry->committer, &sig, parser.line, NULL, 0) < 0) |
1680
|
39 |
0 |
if (c == '\t') { |
1685
|
39 |
0 |
if (parser.line[len - 1] == '\n') |
1689
|
0 |
39 |
GIT_ERROR_CHECK_ALLOC(entry->msg); |
1692
|
0 |
39 |
if ((git_vector_insert(&log->entries, entry)) < 0) { |
1710
|
0 |
7 |
if ((error = git_futils_mkpath2file(filepath, GIT_REFLOG_DIR_MODE)) < 0) |
1713
|
0 |
7 |
if ((fd = p_open(filepath, |
1723
|
77 |
163 |
if (strcmp(name, GIT_HEAD_FILE) == 0) |
1735
|
6 |
0 |
assert(_backend && name); |
|
0 |
6 |
assert(_backend && name); |
1740
|
0 |
6 |
if ((error = retrieve_reflog_path(&path, repo, name)) < 0) |
1754
|
0 |
88 |
if (retrieve_reflog_path(&path, repo, name) < 0) |
1768
|
0 |
0 |
assert(_backend && name); |
|
0 |
0 |
assert(_backend && name); |
1784
|
20 |
0 |
assert(out && _backend && name); |
|
20 |
0 |
assert(out && _backend && name); |
|
0 |
20 |
assert(out && _backend && name); |
1789
|
0 |
20 |
if (reflog_alloc(&log, name) < 0) |
1792
|
0 |
20 |
if (retrieve_reflog_path(&log_path, repo, name) < 0) |
1796
|
1 |
19 |
if (error < 0 && error != GIT_ENOTFOUND) |
|
0 |
1 |
if (error < 0 && error != GIT_ENOTFOUND) |
1799
|
1 |
19 |
if ((error == GIT_ENOTFOUND) && |
|
0 |
1 |
if ((error == GIT_ENOTFOUND) && |
1803
|
0 |
20 |
if ((error = reflog_parse(log, |
1844
|
114 |
7 |
if (msg) { |
1850
|
19193 |
114 |
for (i = 0; i < buf->size - 2; i++) |
1851
|
0 |
19193 |
if (buf->ptr[i] == '\n') |
1869
|
0 |
7 |
if (!git_path_isvalid(backend->repo, refname, 0, GIT_PATH_REJECT_FILESYSTEM_DEFAULTS)) { |
1874
|
0 |
7 |
if (retrieve_reflog_path(&log_path, repo, refname) < 0) |
1877
|
0 |
7 |
if (!git_path_isfile(git_buf_cstr(&log_path))) { |
1901
|
7 |
0 |
assert(_backend && reflog); |
|
0 |
7 |
assert(_backend && reflog); |
1905
|
0 |
7 |
if ((error = lock_reflog(&fbuf, backend, reflog->ref_name)) < 0) |
1908
|
10 |
7 |
git_vector_foreach(&reflog->entries, i, entry) { |
1909
|
0 |
10 |
if (serialize_reflog_entry(&log, &(entry->oid_old), &(entry->oid_cur), entry->committer, entry->msg) < 0) |
1912
|
0 |
10 |
if ((error = git_filebuf_write(&fbuf, log.ptr, log.size)) < 0) |
1939
|
48 |
63 |
if (is_symbolic && |
|
0 |
48 |
if (is_symbolic && |
1940
|
0 |
0 |
strcmp(ref->name, GIT_HEAD_FILE) && |
1941
|
0 |
0 |
!(old && new)) |
1946
|
31 |
80 |
if (old) { |
1950
|
23 |
57 |
if (error < 0 && error != GIT_ENOTFOUND) |
|
0 |
23 |
if (error < 0 && error != GIT_ENOTFOUND) |
1954
|
30 |
81 |
if (new) { |
1957
|
63 |
18 |
if (!is_symbolic) { |
1961
|
0 |
18 |
if (error < 0 && error != GIT_ENOTFOUND) |
|
0 |
0 |
if (error < 0 && error != GIT_ENOTFOUND) |
1964
|
0 |
18 |
if (error == GIT_ENOTFOUND) |
1971
|
0 |
111 |
if ((error = serialize_reflog_entry(&buf, &old_id, &new_id, who, message)) < 0) |
1974
|
0 |
111 |
if ((error = retrieve_reflog_path(&path, repo, ref->name)) < 0) |
1977
|
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) && |
1985
|
0 |
111 |
if (git_path_isdir(git_buf_cstr(&path))) { |
1986
|
0 |
0 |
if ((error = git_futils_rmdir_r(git_buf_cstr(&path), NULL, GIT_RMDIR_SKIP_NONEMPTY)) < 0) { |
1987
|
0 |
0 |
if (error == GIT_ENOTFOUND) |
1989
|
0 |
0 |
} else if (git_path_isdir(git_buf_cstr(&path))) { |
1995
|
0 |
0 |
if (error != 0) |
2001
|
0 |
111 |
if (backend->fsync) |
2023
|
1 |
0 |
assert(_backend && old_name && new_name); |
|
1 |
0 |
assert(_backend && old_name && new_name); |
|
0 |
1 |
assert(_backend && old_name && new_name); |
2028
|
0 |
1 |
if ((error = git_reference__normalize_name( |
2032
|
0 |
1 |
if (git_buf_joinpath(&temp_path, repo->gitdir, GIT_REFLOG_DIR) < 0) |
2035
|
0 |
1 |
if (git_buf_joinpath(&old_path, git_buf_cstr(&temp_path), old_name) < 0) |
2038
|
0 |
1 |
if (git_buf_joinpath(&new_path, git_buf_cstr(&temp_path), git_buf_cstr(&normalized)) < 0) |
2041
|
1 |
0 |
if (!git_path_exists(git_buf_cstr(&old_path))) { |
2053
|
0 |
0 |
if (git_buf_joinpath(&temp_path, git_buf_cstr(&temp_path), "temp_reflog") < 0) |
2056
|
0 |
0 |
if ((fd = git_futils_mktmp(&temp_path, git_buf_cstr(&temp_path), GIT_REFLOG_FILE_MODE)) < 0) { |
2063
|
0 |
0 |
if (p_rename(git_buf_cstr(&old_path), git_buf_cstr(&temp_path)) < 0) { |
2075
|
0 |
0 |
if (git_futils_mkpath2file(git_buf_cstr(&new_path), GIT_REFLOG_DIR_MODE) < 0) { |
2080
|
0 |
0 |
if (p_rename(git_buf_cstr(&temp_path), git_buf_cstr(&new_path)) < 0) { |
2100
|
8 |
0 |
assert(_backend && name); |
|
0 |
8 |
assert(_backend && name); |
2102
|
0 |
8 |
if ((error = retrieve_reflog_path(&path, backend->repo, name)) < 0) |
2105
|
5 |
3 |
if (!git_path_exists(path.ptr)) |
2108
|
0 |
3 |
if ((error = p_unlink(path.ptr)) < 0) |
2128
|
0 |
35 |
GIT_ERROR_CHECK_ALLOC(backend); |
2130
|
0 |
35 |
if (git_refdb_init_backend(&backend->parent, GIT_REFDB_BACKEND_VERSION) < 0) |
2135
|
35 |
0 |
if (repository->gitdir) { |
2138
|
0 |
35 |
if (backend->gitpath == NULL) |
2142
|
35 |
0 |
if (repository->commondir) { |
2145
|
0 |
35 |
if (backend->commonpath == NULL) |
2157
|
35 |
0 |
if (!git_repository__configmap_lookup(&t, backend->repo, GIT_CONFIGMAP_IGNORECASE) && t) { |
|
0 |
35 |
if (!git_repository__configmap_lookup(&t, backend->repo, GIT_CONFIGMAP_IGNORECASE) && t) { |
2161
|
35 |
0 |
if (!git_repository__configmap_lookup(&t, backend->repo, GIT_CONFIGMAP_PRECOMPOSE) && t) { |
|
0 |
35 |
if (!git_repository__configmap_lookup(&t, backend->repo, GIT_CONFIGMAP_PRECOMPOSE) && t) { |
2165
|
35 |
0 |
if ((!git_repository__configmap_lookup(&t, backend->repo, GIT_CONFIGMAP_FSYNCOBJECTFILES) && t) || |
|
35 |
0 |
if ((!git_repository__configmap_lookup(&t, backend->repo, GIT_CONFIGMAP_FSYNCOBJECTFILES) && t) || |
|
0 |
35 |
if ((!git_repository__configmap_lookup(&t, backend->repo, GIT_CONFIGMAP_FSYNCOBJECTFILES) && t) || |