mirror of
https://github.com/git/git
synced 2024-08-25 02:35:46 +00:00
Merge branch 'ps/ahead-behind-truncation-fix'
Fix unnecessary truncation of generation numbers used in-core. * ps/ahead-behind-truncation-fix: commit-graph: fix truncated generation numbers
This commit is contained in:
commit
119e82a515
|
@ -1566,7 +1566,7 @@ static timestamp_t get_generation_from_graph_data(struct commit *c, void *data)
|
||||||
static void set_generation_v2(struct commit *c, timestamp_t t, void *data)
|
static void set_generation_v2(struct commit *c, timestamp_t t, void *data)
|
||||||
{
|
{
|
||||||
struct commit_graph_data *g = commit_graph_data_at(c);
|
struct commit_graph_data *g = commit_graph_data_at(c);
|
||||||
g->generation = (uint32_t)t;
|
g->generation = t;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void compute_generation_numbers(struct write_commit_graph_context *ctx)
|
static void compute_generation_numbers(struct write_commit_graph_context *ctx)
|
||||||
|
|
|
@ -63,4 +63,13 @@ test_expect_success 'set up and verify repo with generation data overflow chunk'
|
||||||
|
|
||||||
graph_git_behavior 'overflow 2' repo left right
|
graph_git_behavior 'overflow 2' repo left right
|
||||||
|
|
||||||
|
test_expect_success 'single commit with generation data exceeding UINT32_MAX' '
|
||||||
|
git init repo-uint32-max &&
|
||||||
|
cd repo-uint32-max &&
|
||||||
|
test_commit --date "@4294967297 +0000" 1 &&
|
||||||
|
git commit-graph write --reachable &&
|
||||||
|
graph_read_expect 1 "generation_data" &&
|
||||||
|
git commit-graph verify
|
||||||
|
'
|
||||||
|
|
||||||
test_done
|
test_done
|
||||||
|
|
Loading…
Reference in a new issue