Skip to content

Commit 637ab37

Browse files
committed
commitgraph: don't update finalized hash
Ensure that we don't update the finalized commit graph hash; clear it instead.
1 parent b02a858 commit 637ab37

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/libgit2/commit_graph.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,9 +1027,12 @@ static int commit_graph_write_hash(const char *buf, size_t size, void *data)
10271027
struct commit_graph_write_hash_context *ctx = data;
10281028
int error;
10291029

1030-
error = git_hash_update(ctx->ctx, buf, size);
1031-
if (error < 0)
1032-
return error;
1030+
if (ctx->ctx) {
1031+
error = git_hash_update(ctx->ctx, buf, size);
1032+
1033+
if (error < 0)
1034+
return error;
1035+
}
10331036

10341037
return ctx->write_cb(buf, size, ctx->cb_data);
10351038
}
@@ -1225,6 +1228,9 @@ static int commit_graph_write(
12251228
error = git_hash_final(checksum, &ctx);
12261229
if (error < 0)
12271230
goto cleanup;
1231+
1232+
hash_cb_data.ctx = NULL;
1233+
12281234
error = write_cb((char *)checksum, checksum_size, cb_data);
12291235
if (error < 0)
12301236
goto cleanup;

0 commit comments

Comments
 (0)