path: adjust last remaining users of the_repository
With the preceding refactorings we now only have a couple of implicit users of `the_repository` left in the "path" subsystem, all of which depend on global state via `calc_shared_perm()`. Make the dependency on `the_repository` explicit by passing the repo as a parameter instead and adjust callers accordingly. Note that this change bubbles up into a couple of subsystems that were previously declared as free from `the_repository`. Instead of marking all of them as `the_repository`-dependent again, we instead use the repository that is available in the calling context. There are three exceptions though with "copy.c", "pack-write.c" and "tempfile.c". Adjusting these would require us to adapt callsites all over the place, so this is left for a future iteration. Mark "path.c" as free from `the_repository`. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
f1ce861c34
commit
028f618658
@@ -2084,7 +2084,7 @@ static int write_commit_graph_file(struct write_commit_graph_context *ctx)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (adjust_shared_perm(get_tempfile_path(graph_layer))) {
|
||||
if (adjust_shared_perm(the_repository, get_tempfile_path(graph_layer))) {
|
||||
error(_("unable to adjust shared permissions for '%s'"),
|
||||
get_tempfile_path(graph_layer));
|
||||
return -1;
|
||||
|
||||
Reference in New Issue
Block a user