summaryrefslogtreecommitdiff
path: root/builtin/rev-list.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-09-01 22:43:34 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-09-01 22:46:13 (GMT)
commit5a48d24012fa39cdd02c1cb614db2e62d445e2ce (patch)
tree3803d06e4bcdb2c3e45c53ebefa1b3098a86d28a /builtin/rev-list.c
parent4947367267cbcd0ca528711b2393613e2e817878 (diff)
downloadgit-5a48d24012fa39cdd02c1cb614db2e62d445e2ce.zip
git-5a48d24012fa39cdd02c1cb614db2e62d445e2ce.tar.gz
git-5a48d24012fa39cdd02c1cb614db2e62d445e2ce.tar.bz2
rev-list --verify-object
Often we want to verify everything reachable from a given set of commits are present in our repository and connected without a gap to the tips of our refs. We used to do this for this purpose: $ rev-list --objects $commits_to_be_tested --not --all Even though this is good enough for catching missing commits and trees, we show the object name but do not verify their existence, let alone their well-formedness, for the blob objects at the leaf level. Add a new "--verify-object" option so that we can catch missing and broken blobs as well. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/rev-list.c')
-rw-r--r--builtin/rev-list.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/builtin/rev-list.c b/builtin/rev-list.c
index 920b91c..ab3be7c 100644
--- a/builtin/rev-list.c
+++ b/builtin/rev-list.c
@@ -180,7 +180,11 @@ static void show_object(struct object *obj,
const struct name_path *path, const char *component,
void *cb_data)
{
+ 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);
}