diff options
author | Junio C Hamano <gitster@pobox.com> | 2019-11-04 05:33:06 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-11-04 05:33:06 +0100 |
commit | dac1d83c919430aa73f8df21854a08a7b9a95837 (patch) | |
tree | 6475df2d345f60f20d31c5afbf3b782cef3ca627 /commit-graph.c | |
parent | Merge branch 'jt/delay-fetch-if-missing' (diff) | |
parent | commit-graph: fix writing first commit-graph during fetch (diff) | |
download | git-dac1d83c919430aa73f8df21854a08a7b9a95837.tar.xz git-dac1d83c919430aa73f8df21854a08a7b9a95837.zip |
Merge branch 'ds/commit-graph-on-fetch'
Regression fix.
* ds/commit-graph-on-fetch:
commit-graph: fix writing first commit-graph during fetch
t5510-fetch.sh: demonstrate fetch.writeCommitGraph bug
Diffstat (limited to 'commit-graph.c')
-rw-r--r-- | commit-graph.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/commit-graph.c b/commit-graph.c index fc4a43b8d6..0aea7b2ae5 100644 --- a/commit-graph.c +++ b/commit-graph.c @@ -41,6 +41,9 @@ #define GRAPH_MIN_SIZE (GRAPH_HEADER_SIZE + 4 * GRAPH_CHUNKLOOKUP_WIDTH \ + GRAPH_FANOUT_SIZE + the_hash_algo->rawsz) +/* Remember to update object flag allocation in object.h */ +#define REACHABLE (1u<<15) + 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); } |