diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-07-18 00:46:19 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-07-18 00:46:19 +0200 |
commit | 8295296458bfa5e371dccae0a0e0a4b9a56f9b40 (patch) | |
tree | e519d64f5604a0532c946185a2b6a51beeb06b5f /commit.c | |
parent | commit.c: allow lookup_commit_reference to handle arbitrary repositories (diff) | |
parent | coccinelle: update commit.cocci (diff) | |
download | git-8295296458bfa5e371dccae0a0e0a4b9a56f9b40.tar.xz git-8295296458bfa5e371dccae0a0e0a4b9a56f9b40.zip |
Merge branch 'ds/commit-graph-fsck' into jt/commit-graph-per-object-store
* ds/commit-graph-fsck: (23 commits)
coccinelle: update commit.cocci
commit-graph: update design document
gc: automatically write commit-graph files
commit-graph: add '--reachable' option
commit-graph: use string-list API for input
fsck: verify commit-graph
commit-graph: verify contents match checksum
commit-graph: test for corrupted octopus edge
commit-graph: verify commit date
commit-graph: verify generation number
commit-graph: verify parent list
commit-graph: verify root tree OIDs
commit-graph: verify objects exist
commit-graph: verify corrupt OID fanout and lookup
commit-graph: verify required chunks are present
commit-graph: verify catches corrupt signature
commit-graph: add 'verify' subcommand
commit-graph: load a root tree from specific graph
commit: force commit to parse from object database
commit-graph: parse commit from chosen graph
...
Diffstat (limited to 'commit.c')
-rw-r--r-- | commit.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -443,7 +443,7 @@ int parse_commit_buffer(struct repository *r, struct commit *item, const void *b return 0; } -int parse_commit_gently(struct commit *item, int quiet_on_missing) +int parse_commit_internal(struct commit *item, int quiet_on_missing, int use_commit_graph) { enum object_type type; void *buffer; @@ -454,7 +454,7 @@ int parse_commit_gently(struct commit *item, int quiet_on_missing) return -1; if (item->object.parsed) return 0; - if (parse_commit_in_graph(item)) + if (use_commit_graph && parse_commit_in_graph(item)) return 0; buffer = read_object_file(&item->object.oid, &type, &size); if (!buffer) @@ -466,6 +466,7 @@ int parse_commit_gently(struct commit *item, int quiet_on_missing) return error("Object %s not a commit", oid_to_hex(&item->object.oid)); } + ret = parse_commit_buffer(the_repository, item, buffer, size, 0); if (save_commit_buffer && !ret) { set_commit_buffer(the_repository, item, buffer, size); @@ -475,6 +476,11 @@ int parse_commit_gently(struct commit *item, int quiet_on_missing) return ret; } +int parse_commit_gently(struct commit *item, int quiet_on_missing) +{ + return parse_commit_internal(item, quiet_on_missing, 1); +} + void parse_commit_or_die(struct commit *item) { if (parse_commit(item)) |