about summary refs log tree commit diff stats
path: root/ui-blob.c
diff options
context:
space:
mode:
Diffstat (limited to 'ui-blob.c')
-rw-r--r--ui-blob.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/ui-blob.c b/ui-blob.c index 30e2d4b..f76c641 100644 --- a/ui-blob.c +++ b/ui-blob.c
@@ -56,8 +56,9 @@ int cgit_ref_path_exists(const char *path, const char *ref, int file_only)
56 goto done; 56 goto done;
57 if (oid_object_info(the_repository, &oid, &size) != OBJ_COMMIT) 57 if (oid_object_info(the_repository, &oid, &size) != OBJ_COMMIT)
58 goto done; 58 goto done;
59 read_tree_recursive(the_repository, lookup_commit_reference(the_repository, &oid)->maybe_tree, 59 read_tree_recursive(the_repository,
60 "", 0, 0, &paths, walk_tree, &walk_tree_ctx); 60 repo_get_commit_tree(the_repository, lookup_commit_reference(the_repository, &oid)),
61 "", 0, 0, &paths, walk_tree, &walk_tree_ctx);
61 62
62done: 63done:
63 free(path_items.match); 64 free(path_items.match);
@@ -91,8 +92,10 @@ int cgit_print_file(char *path, const char *head, int file_only)
91 type = oid_object_info(the_repository, &oid, &size); 92 type = oid_object_info(the_repository, &oid, &size);
92 if (type == OBJ_COMMIT) { 93 if (type == OBJ_COMMIT) {
93 commit = lookup_commit_reference(the_repository, &oid); 94 commit = lookup_commit_reference(the_repository, &oid);
94 read_tree_recursive(the_repository, commit->maybe_tree, 95 read_tree_recursive(the_repository,
95 "", 0, 0, &paths, walk_tree, &walk_tree_ctx); 96 repo_get_commit_tree(the_repository, commit),
97 "", 0, 0, &paths, walk_tree,
98 &walk_tree_ctx);
96 if (!walk_tree_ctx.found_path) 99 if (!walk_tree_ctx.found_path)
97 return -1; 100 return -1;
98 type = oid_object_info(the_repository, &oid, &size); 101 type = oid_object_info(the_repository, &oid, &size);
@@ -148,8 +151,10 @@ void cgit_print_blob(const char *hex, char *path, const char *head, int file_onl
148 151
149 if ((!hex) && type == OBJ_COMMIT && path) { 152 if ((!hex) && type == OBJ_COMMIT && path) {
150 commit = lookup_commit_reference(the_repository, &oid); 153 commit = lookup_commit_reference(the_repository, &oid);
151 read_tree_recursive(the_repository, commit->maybe_tree, 154 read_tree_recursive(the_repository,
152 "", 0, 0, &paths, walk_tree, &walk_tree_ctx); 155 repo_get_commit_tree(the_repository, commit),
156 "", 0, 0, &paths, walk_tree,
157 &walk_tree_ctx);
153 type = oid_object_info(the_repository, &oid, &size); 158 type = oid_object_info(the_repository, &oid, &size);
154 } 159 }
155 160