-
Notifications
You must be signed in to change notification settings - Fork 151
[v2.24.0-rc0 BUG] fetch.writeCommitGraph fails on first fetch #415
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,6 +41,9 @@ | |
#define GRAPH_MIN_SIZE (GRAPH_HEADER_SIZE + 4 * GRAPH_CHUNKLOOKUP_WIDTH \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, SZEDER Gábor wrote (reply to this):
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Derrick Stolee wrote (reply to this):
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, SZEDER Gábor wrote (reply to this):
|
||
+ GRAPH_FANOUT_SIZE + the_hash_algo->rawsz) | ||
|
||
/* Remember to update object flag allocation in object.h */ | ||
#define REACHABLE (1u<<15) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a magic constant in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In |
||
|
||
char *get_commit_graph_filename(const char *obj_dir) | ||
{ | ||
char *filename = xstrfmt("%s/info/commit-graph", obj_dir); | ||
|
@@ -1030,11 +1033,11 @@ static void add_missing_parents(struct write_commit_graph_context *ctx, struct c | |
{ | ||
struct commit_list *parent; | ||
for (parent = commit->parents; parent; parent = parent->next) { | ||
if (!(parent->item->object.flags & UNINTERESTING)) { | ||
if (!(parent->item->object.flags & REACHABLE)) { | ||
ALLOC_GROW(ctx->oids.list, ctx->oids.nr + 1, ctx->oids.alloc); | ||
oidcpy(&ctx->oids.list[ctx->oids.nr], &(parent->item->object.oid)); | ||
ctx->oids.nr++; | ||
parent->item->object.flags |= UNINTERESTING; | ||
parent->item->object.flags |= REACHABLE; | ||
} | ||
} | ||
} | ||
|
@@ -1052,7 +1055,7 @@ static void close_reachable(struct write_commit_graph_context *ctx) | |
display_progress(ctx->progress, i + 1); | ||
commit = lookup_commit(ctx->r, &ctx->oids.list[i]); | ||
if (commit) | ||
commit->object.flags |= UNINTERESTING; | ||
commit->object.flags |= REACHABLE; | ||
} | ||
stop_progress(&ctx->progress); | ||
|
||
|
@@ -1089,7 +1092,7 @@ static void close_reachable(struct write_commit_graph_context *ctx) | |
commit = lookup_commit(ctx->r, &ctx->oids.list[i]); | ||
|
||
if (commit) | ||
commit->object.flags &= ~UNINTERESTING; | ||
commit->object.flags &= ~REACHABLE; | ||
} | ||
stop_progress(&ctx->progress); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -583,6 +583,22 @@ test_expect_success 'fetch.writeCommitGraph' ' | |
) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, SZEDER Gábor wrote (reply to this):
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On the Git mailing list, Derrick Stolee wrote (reply to this):
|
||
' | ||
|
||
test_expect_success 'fetch.writeCommitGraph with submodules' ' | ||
git clone dups super && | ||
( | ||
cd super && | ||
git submodule add "file://$TRASH_DIRECTORY/three" && | ||
git commit -m "add submodule" | ||
) && | ||
git clone "super" super-clone && | ||
( | ||
cd super-clone && | ||
rm -rf .git/objects/info && | ||
git -c fetch.writeCommitGraph=true fetch origin && | ||
test_path_is_file .git/objects/info/commit-graphs/commit-graph-chain | ||
) | ||
' | ||
|
||
# configured prune tests | ||
|
||
set_config_tristate () { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the Git mailing list, Jeff King wrote (reply to this):
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the Git mailing list, Jeff King wrote (reply to this):
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the Git mailing list, SZEDER Gábor wrote (reply to this):
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the Git mailing list, Derrick Stolee wrote (reply to this):
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the Git mailing list, Jeff King wrote (reply to this):
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the Git mailing list, Jeff King wrote (reply to this):