Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
ae66969
commit-graph: UNLEAK before die()
derrickstolee May 24, 2018
0a18dc4
commit-graph: fix GRAPH_MIN_SIZE
derrickstolee May 24, 2018
52280bb
commit-graph: parse commit from chosen graph
derrickstolee May 24, 2018
fc52376
commit: force commit to parse from object database
derrickstolee May 24, 2018
3c84326
commit-graph: load a root tree from specific graph
derrickstolee May 24, 2018
cb74de9
commit-graph: add 'verify' subcommand
derrickstolee May 24, 2018
38828ce
commit-graph: verify catches corrupt signature
derrickstolee May 24, 2018
f54079f
commit-graph: verify required chunks are present
derrickstolee May 24, 2018
f78bda6
commit-graph: verify corrupt OID fanout and lookup
derrickstolee May 24, 2018
4dfc871
commit-graph: verify objects exist
derrickstolee May 24, 2018
21501ee
commit-graph: verify root tree OIDs
derrickstolee May 24, 2018
d3b303f
commit-graph: verify parent list
derrickstolee May 24, 2018
4d1d630
commit-graph: verify generation number
derrickstolee May 24, 2018
80b6f0f
commit-graph: verify commit date
derrickstolee May 24, 2018
702c382
commit-graph: test for corrupted octopus edge
derrickstolee May 24, 2018
672a9c4
commit-graph: verify contents match checksum
derrickstolee May 24, 2018
d3b7938
fsck: verify commit-graph
derrickstolee May 24, 2018
b7c9bf6
commit-graph: use string-list API for input
derrickstolee Jun 4, 2018
49958e2
commit-graph: add '--reachable' option
derrickstolee May 24, 2018
b63137f
gc: automatically write commit-graph files
derrickstolee May 24, 2018
d2b0f48
commit-graph: update design document
derrickstolee May 24, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
commit-graph: verify commit date
Signed-off-by: Derrick Stolee <[email protected]>
  • Loading branch information
derrickstolee committed Jun 27, 2018
commit 80b6f0f23e0190c64b9460619f57f5b516cd2e04
6 changes: 6 additions & 0 deletions commit-graph.c
Original file line number Diff line number Diff line change
Expand Up @@ -986,6 +986,12 @@ int verify_commit_graph(struct repository *r, struct commit_graph *g)
oid_to_hex(&cur_oid),
graph_commit->generation,
max_generation + 1);

if (graph_commit->date != odb_commit->date)
graph_report("commit date for commit %s in commit-graph is %"PRItime" != %"PRItime,
oid_to_hex(&cur_oid),
graph_commit->date,
odb_commit->date);
}

return verify_commit_graph_error;
Expand Down
6 changes: 6 additions & 0 deletions t/t5318-commit-graph.sh
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ GRAPH_BYTE_COMMIT_PARENT=$(($GRAPH_COMMIT_DATA_OFFSET + $HASH_LEN))
GRAPH_BYTE_COMMIT_EXTRA_PARENT=$(($GRAPH_COMMIT_DATA_OFFSET + $HASH_LEN + 4))
GRAPH_BYTE_COMMIT_WRONG_PARENT=$(($GRAPH_COMMIT_DATA_OFFSET + $HASH_LEN + 3))
GRAPH_BYTE_COMMIT_GENERATION=$(($GRAPH_COMMIT_DATA_OFFSET + $HASH_LEN + 11))
GRAPH_BYTE_COMMIT_DATE=$(($GRAPH_COMMIT_DATA_OFFSET + $HASH_LEN + 12))

# usage: corrupt_graph_and_verify <position> <data> <string>
# Manipulates the commit-graph file at the position
Expand Down Expand Up @@ -377,4 +378,9 @@ test_expect_success 'detect incorrect generation number' '
"non-zero generation number"
'

test_expect_success 'detect incorrect commit date' '
corrupt_graph_and_verify $GRAPH_BYTE_COMMIT_DATE "\01" \
"commit date"
'

test_done