#include "cache.h"
#include "walker.h"
+#include "object-store.h"
#include "commit.h"
#include "tree.h"
#include "tree-walk.h"
static void report_missing(const struct object *obj)
{
fprintf(stderr, "Cannot obtain needed %s %s\n",
- obj->type ? typename(obj->type): "object",
+ obj->type ? type_name(obj->type): "object",
oid_to_hex(&obj->oid));
if (!is_null_oid(¤t_commit_oid))
fprintf(stderr, "while processing commit %s.\n",
static int process_commit(struct walker *walker, struct commit *commit)
{
+ struct commit_list *parents;
+
if (parse_commit(commit))
return -1;
walker_say(walker, "walk %s\n", oid_to_hex(&commit->object.oid));
- if (walker->get_tree) {
- if (process(walker, &commit->tree->object))
+ if (process(walker, &get_commit_tree(commit)->object))
+ return -1;
+
+ for (parents = commit->parents; parents; parents = parents->next) {
+ if (process(walker, &parents->item->object))
return -1;
- if (!walker->get_all)
- walker->get_tree = 0;
- }
- if (walker->get_history) {
- struct commit_list *parents = commit->parents;
- for (; parents; parents = parents->next) {
- if (process(walker, &parents->item->object))
- return -1;
- }
}
+
return 0;
}
}
return error("Unable to determine requirements "
"of type %s for %s",
- typename(obj->type), oid_to_hex(&obj->oid));
+ type_name(obj->type), oid_to_hex(&obj->oid));
}
static int process(struct walker *walker, struct object *obj)