summaryrefslogtreecommitdiff
path: root/commit-graph.c
diff options
context:
space:
mode:
authorTaylor Blau <me@ttaylorr.com>2020-04-29 17:36:42 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-04-29 19:35:30 (GMT)
commitf4d62847a431af965b8a6895b92f4372042457b0 (patch)
treea0348d9085c67b2ad3b9605137d2ceaefffd8cbc /commit-graph.c
parent1f9becaedc9266651145a146fb63b84c3ee79d95 (diff)
downloadgit-f4d62847a431af965b8a6895b92f4372042457b0.zip
git-f4d62847a431af965b8a6895b92f4372042457b0.tar.gz
git-f4d62847a431af965b8a6895b92f4372042457b0.tar.bz2
commit-graph.c: ensure graph layers respect core.sharedRepository
Non-layered commit-graphs use 'adjust_shared_perm' to make the commit-graph file readable (or not) to a combination of the user, group, and others. Call 'adjust_shared_perm' for split-graph layers to make sure that these also respect 'core.sharedRepository'. The 'commit-graph-chain' file already respects this configuration since it uses 'hold_lock_file_for_update' (which calls 'adjust_shared_perm' eventually in 'create_tempfile_mode'). Suggested-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit-graph.c')
-rw-r--r--commit-graph.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/commit-graph.c b/commit-graph.c
index 5b5047a..d05a559 100644
--- a/commit-graph.c
+++ b/commit-graph.c
@@ -1386,6 +1386,12 @@ static int write_commit_graph_file(struct write_commit_graph_context *ctx)
return -1;
}
+ if (adjust_shared_perm(ctx->graph_name)) {
+ error(_("unable to adjust shared permissions for '%s'"),
+ ctx->graph_name);
+ return -1;
+ }
+
f = hashfd(fd, ctx->graph_name);
} else {
hold_lock_file_for_update_mode(&lk, ctx->graph_name,