summaryrefslogtreecommitdiff
path: root/builtin/rev-list.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-10-05 12:36:20 -0700
committerJunio C Hamano <gitster@pobox.com>2011-10-05 12:36:20 -0700
commit2e2e7e9dd07107af8ce96428929775f267fdf98a (patch)
tree2ad475466a598a0004fa13cb0e5a5eb53fa559e2 /builtin/rev-list.c
parentca0c9764bfe4f5d33551b5cca74eb0966f796baf (diff)
parent6b67e0dc068d1bfd07686071b70f60078380666f (diff)
Merge branch 'jc/fetch-verify'
* jc/fetch-verify: fetch: verify we have everything we need before updating our ref rev-list --verify-object list-objects: pass callback data to show_objects()
Diffstat (limited to 'builtin/rev-list.c')
-rw-r--r--builtin/rev-list.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/builtin/rev-list.c b/builtin/rev-list.c
index f5ce4873e3..ab3be7ca82 100644
--- a/builtin/rev-list.c
+++ b/builtin/rev-list.c
@@ -168,15 +168,23 @@ static void finish_commit(struct commit *commit, void *data)
commit->buffer = NULL;
}
-static void finish_object(struct object *obj, const struct name_path *path, const char *name)
+static void finish_object(struct object *obj,
+ const struct name_path *path, const char *name,
+ void *cb_data)
{
if (obj->type == OBJ_BLOB && !has_sha1_file(obj->sha1))
die("missing blob object '%s'", sha1_to_hex(obj->sha1));
}
-static void show_object(struct object *obj, const struct name_path *path, const char *component)
+static void show_object(struct object *obj,
+ const struct name_path *path, const char *component,
+ void *cb_data)
{
- finish_object(obj, path, component);
+ struct rev_info *info = cb_data;
+
+ finish_object(obj, path, component, cb_data);
+ if (info->verify_objects && !obj->parsed && obj->type != OBJ_COMMIT)
+ parse_object(obj->sha1);
show_object_with_name(stdout, obj, path, component);
}