Skip to content

Commit

Permalink
run-command: terrible hack for loading config
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
peff committed Jan 3, 2025
1 parent f0be3f4 commit f776a2f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions git.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "shallow.h"
#include "trace.h"
#include "trace2.h"
#include "wrapper.h"

#define RUN_SETUP (1<<0)
#define RUN_SETUP_GENTLY (1<<1)
Expand Down
2 changes: 1 addition & 1 deletion run-command.c
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ int start_command(struct child_process *cmd)
int failed_errno;
const char *str;

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

/*
Expand Down

0 comments on commit f776a2f

Please sign in to comment.