Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion commit-graph.c
Original file line number Diff line number Diff line change
Expand Up @@ -1669,7 +1669,7 @@ static void compute_reachable_generation_numbers(
struct commit *current = list->item;
struct commit_list *parent;
int all_parents_computed = 1;
uint32_t max_gen = 0;
timestamp_t max_gen = 0;

for (parent = current->parents; parent; parent = parent->next) {
repo_parse_commit(info->r, parent->item);
Expand Down
9 changes: 9 additions & 0 deletions t/t5328-commit-graph-64bit-time.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,15 @@ test_expect_success 'single commit with generation data exceeding UINT32_MAX' '
git -C repo-uint32-max commit-graph verify
'

test_expect_success 'descendant of commit with date exceeding UINT32_MAX' '
git init repo-uint32-max-descendant &&
test_commit -C repo-uint32-max-descendant \
--date "@4294967300 +0000" future-parent &&
test_commit -C repo-uint32-max-descendant present-day-child &&
git -C repo-uint32-max-descendant commit-graph write --reachable &&
git -C repo-uint32-max-descendant commit-graph verify
'

test_expect_success PERL_TEST_HELPERS 'reader notices out-of-bounds generation overflow' '
graph=.git/objects/info/commit-graph &&
test_when_finished "rm -rf $graph" &&
Expand Down
Loading