aboutsummaryrefslogtreecommitdiffstats
path: root/commit-graph.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-01-25 14:19:17 -0800
committerJunio C Hamano <gitster@pobox.com>2021-01-25 14:19:17 -0800
commit58e2ce9112446935a1294d095a07390ed665a6bc (patch)
tree9ea2ea6bae6a513e3e3ac9925e2149fd501be379 /commit-graph.c
parent2856089e367cc126f70d0a3d6d6ff5290d204f2e (diff)
parent6a8c89d053059b97adb846fce1d22f6d7704c56a (diff)
downloadgit-58e2ce9112446935a1294d095a07390ed665a6bc.tar.gz
Merge branch 'ma/more-opaque-lock-file'
Code clean-up. * ma/more-opaque-lock-file: read-cache: try not to peek into `struct {lock_,temp}file` refs/files-backend: don't peek into `struct lock_file` midx: don't peek into `struct lock_file` commit-graph: don't peek into `struct lock_file` builtin/gc: don't peek into `struct lock_file`
Diffstat (limited to 'commit-graph.c')
-rw-r--r--commit-graph.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/commit-graph.c b/commit-graph.c
index e9124d4a41..f3486ec18f 100644
--- a/commit-graph.c
+++ b/commit-graph.c
@@ -1694,8 +1694,8 @@ static int write_commit_graph_file(struct write_commit_graph_context *ctx)
} else {
hold_lock_file_for_update_mode(&lk, ctx->graph_name,
LOCK_DIE_ON_ERROR, 0444);
- fd = lk.tempfile->fd;
- f = hashfd(lk.tempfile->fd, lk.tempfile->filename.buf);
+ fd = get_lock_file_fd(&lk);
+ f = hashfd(fd, get_lock_file_path(&lk));
}
chunks[0].id = GRAPH_CHUNKID_OIDFANOUT;
@@ -1833,7 +1833,7 @@ static int write_commit_graph_file(struct write_commit_graph_context *ctx)
result = rename(ctx->graph_name, final_graph_name);
for (i = 0; i < ctx->num_commit_graphs_after; i++)
- fprintf(lk.tempfile->fp, "%s\n", ctx->commit_graph_hash_after[i]);
+ fprintf(get_lock_file_fp(&lk), "%s\n", ctx->commit_graph_hash_after[i]);
if (result) {
error(_("failed to rename temporary commit-graph file"));