Skip to content

Commit 72b51e1

Browse files
committed
run-command: terrible hack for loading config
It's not safe to look at config before we've done setup_git_directory(), as we may pollute the results of a later call. This is a hack because: 1. we just silently disable this feature in this case (!) 2. is_bare_repository_cfg is probably not the best way to know whether we've done setup or not. Signed-off-by: Jeff King <peff@peff.net>
1 parent b9b5924 commit 72b51e1

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

git.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "shallow.h"
1818
#include "trace.h"
1919
#include "trace2.h"
20+
#include "wrapper.h"
2021

2122
#define RUN_SETUP (1<<0)
2223
#define RUN_SETUP_GENTLY (1<<1)

run-command.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ int start_command(struct child_process *cmd)
681681
int failed_errno;
682682
const char *str;
683683

684-
if (cmd->git_cmd)
684+
if (cmd->git_cmd && is_bare_repository_cfg >= 0)
685685
trace_config_for(the_repository, cmd->args.v[0], &cmd->env);
686686

687687
/*

0 commit comments

Comments
 (0)