Skip to content

Commit a52cdce

Browse files
Martin Ågrengitster
authored andcommitted
commit-graph: don't peek into struct lock_file
Similar to the previous commit, avoid peeking into the `struct lock_file`. Use the lock file API instead. Signed-off-by: Martin Ågren <[email protected]> Reviewed-by: Derrick Stolee <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d4a4976 commit a52cdce

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

commit-graph.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1694,8 +1694,8 @@ static int write_commit_graph_file(struct write_commit_graph_context *ctx)
16941694
} else {
16951695
hold_lock_file_for_update_mode(&lk, ctx->graph_name,
16961696
LOCK_DIE_ON_ERROR, 0444);
1697-
fd = lk.tempfile->fd;
1698-
f = hashfd(lk.tempfile->fd, lk.tempfile->filename.buf);
1697+
fd = get_lock_file_fd(&lk);
1698+
f = hashfd(fd, get_lock_file_path(&lk));
16991699
}
17001700

17011701
chunks[0].id = GRAPH_CHUNKID_OIDFANOUT;
@@ -1833,7 +1833,7 @@ static int write_commit_graph_file(struct write_commit_graph_context *ctx)
18331833
result = rename(ctx->graph_name, final_graph_name);
18341834

18351835
for (i = 0; i < ctx->num_commit_graphs_after; i++)
1836-
fprintf(lk.tempfile->fp, "%s\n", ctx->commit_graph_hash_after[i]);
1836+
fprintf(get_lock_file_fp(&lk), "%s\n", ctx->commit_graph_hash_after[i]);
18371837

18381838
if (result) {
18391839
error(_("failed to rename temporary commit-graph file"));

0 commit comments

Comments
 (0)