summaryrefslogtreecommitdiff
path: root/walker.c
diff options
context:
space:
mode:
Diffstat (limited to 'walker.c')
-rw-r--r--walker.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/walker.c b/walker.c
index 65002a7220..7cc9dbea46 100644
--- a/walker.c
+++ b/walker.c
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "gettext.h"
#include "hex.h"
@@ -45,7 +47,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;
@@ -155,7 +157,7 @@ static int process(struct walker *walker, struct object *obj)
else {
if (obj->flags & COMPLETE)
return 0;
- walker->prefetch(walker, obj->oid.hash);
+ walker->prefetch(walker, &obj->oid);
}
object_list_insert(obj, process_queue_end);
@@ -184,7 +186,7 @@ static int loop(struct walker *walker)
* the queue because we needed to fetch it first.
*/
if (! (obj->flags & TO_SCAN)) {
- if (walker->fetch(walker, obj->oid.hash)) {
+ if (walker->fetch(walker, &obj->oid)) {
stop_progress(&progress);
report_missing(obj);
return -1;
@@ -219,6 +221,7 @@ static int interpret_target(struct walker *walker, char *target, struct object_i
}
static int mark_complete(const char *path UNUSED,
+ const char *referent UNUSED,
const struct object_id *oid,
int flag UNUSED,
void *cb_data UNUSED)
@@ -286,7 +289,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),
+ 0, &err);
if (!transaction) {
error("%s", err.buf);
goto done;
@@ -294,7 +298,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);
}
@@ -324,7 +329,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);