Skip to content

Commit 71c3967

Browse files
committed
Merge branch 'jh/trace2-sid-fix' into next
Polishing of the new trace2 facility continues. The system-level configuration can specify site-wide trace2 settings, which can be overridden with per-user configuration and environment variables. * jh/trace2-sid-fix: trace2: fixup access problem on /etc/gitconfig in read_very_early_config
2 parents 81c186e + f672dee commit 71c3967

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

config.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1676,7 +1676,9 @@ static int do_git_config_sequence(const struct config_options *opts,
16761676
repo_config = NULL;
16771677

16781678
current_parsing_scope = CONFIG_SCOPE_SYSTEM;
1679-
if (git_config_system() && !access_or_die(git_etc_gitconfig(), R_OK, 0))
1679+
if (git_config_system() && !access_or_die(git_etc_gitconfig(), R_OK,
1680+
opts->system_gently ?
1681+
ACCESS_EACCES_OK : 0))
16801682
ret += git_config_from_file(fn, git_etc_gitconfig(),
16811683
data);
16821684

@@ -1807,6 +1809,7 @@ void read_very_early_config(config_fn_t cb, void *data)
18071809
opts.ignore_repo = 1;
18081810
opts.ignore_worktree = 1;
18091811
opts.ignore_cmdline = 1;
1812+
opts.system_gently = 1;
18101813

18111814
config_with_options(cb, data, NULL, &opts);
18121815
}

config.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ struct config_options {
5858
unsigned int ignore_repo : 1;
5959
unsigned int ignore_worktree : 1;
6060
unsigned int ignore_cmdline : 1;
61+
unsigned int system_gently : 1;
6162
const char *commondir;
6263
const char *git_dir;
6364
config_parser_event_fn_t event_fn;

0 commit comments

Comments
 (0)