diff options
Diffstat (limited to 'walker.c')
| -rw-r--r-- | walker.c | 23 |
1 files changed, 14 insertions, 9 deletions
@@ -1,8 +1,11 @@ -#include "cache.h" +#include "git-compat-util.h" +#include "gettext.h" +#include "hex.h" #include "walker.h" #include "repository.h" -#include "object-store.h" +#include "object-store-ll.h" #include "commit.h" +#include "strbuf.h" #include "tree.h" #include "tree-walk.h" #include "tag.h" @@ -42,7 +45,7 @@ static int process_tree(struct walker *walker, struct tree *tree) if (parse_tree(tree)) return -1; - init_tree_desc(&desc, tree->buffer, tree->size); + init_tree_desc(&desc, &tree->object.oid, tree->buffer, tree->size); while (tree_entry(&desc, &entry)) { struct object *obj = NULL; @@ -79,7 +82,7 @@ static int process_commit(struct walker *walker, struct commit *commit) { struct commit_list *parents; - if (parse_commit(commit)) + if (repo_parse_commit(the_repository, commit)) return -1; while (complete && complete->item->date >= commit->date) { @@ -93,7 +96,7 @@ static int process_commit(struct walker *walker, struct commit *commit) walker_say(walker, "walk %s\n", oid_to_hex(&commit->object.oid)); - if (process(walker, &get_commit_tree(commit)->object)) + if (process(walker, &repo_get_commit_tree(the_repository, commit)->object)) return -1; for (parents = commit->parents; parents; parents = parents->next) { @@ -145,7 +148,7 @@ static int process(struct walker *walker, struct object *obj) return 0; obj->flags |= SEEN; - if (has_object_file(&obj->oid)) { + if (repo_has_object_file(the_repository, &obj->oid)) { /* We already have it, so we should scan it now. */ obj->flags |= TO_SCAN; } @@ -283,7 +286,8 @@ int walker_fetch(struct walker *walker, int targets, char **target, ALLOC_ARRAY(oids, targets); if (write_ref) { - transaction = ref_transaction_begin(&err); + transaction = ref_store_transaction_begin(get_main_ref_store(the_repository), + &err); if (!transaction) { error("%s", err.buf); goto done; @@ -291,7 +295,8 @@ int walker_fetch(struct walker *walker, int targets, char **target, } if (!walker->get_recover) { - for_each_ref(mark_complete, NULL); + refs_for_each_ref(get_main_ref_store(the_repository), + mark_complete, NULL); commit_list_sort_by_date(&complete); } @@ -321,7 +326,7 @@ int walker_fetch(struct walker *walker, int targets, char **target, strbuf_reset(&refname); strbuf_addf(&refname, "refs/%s", write_ref[i]); if (ref_transaction_update(transaction, refname.buf, - oids + i, NULL, 0, + oids + i, NULL, NULL, NULL, 0, msg ? msg : "fetch (unknown)", &err)) { error("%s", err.buf); |
