summaryrefslogtreecommitdiff
path: root/transport.c
diff options
context:
space:
mode:
Diffstat (limited to 'transport.c')
-rw-r--r--transport.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/transport.c b/transport.c
index 25d8ea7fe5..19baec7942 100644
--- a/transport.c
+++ b/transport.c
@@ -1328,10 +1328,21 @@ literal_copy:
static void fill_alternate_refs_command(struct child_process *cmd,
const char *repo_path)
{
- cmd->git_cmd = 1;
- argv_array_pushf(&cmd->args, "--git-dir=%s", repo_path);
- argv_array_push(&cmd->args, "for-each-ref");
- argv_array_push(&cmd->args, "--format=%(objectname)");
+ const char *value;
+
+ if (!git_config_get_value("core.alternateRefsCommand", &value)) {
+ cmd->use_shell = 1;
+
+ argv_array_push(&cmd->args, value);
+ argv_array_push(&cmd->args, repo_path);
+ } else {
+ cmd->git_cmd = 1;
+
+ argv_array_pushf(&cmd->args, "--git-dir=%s", repo_path);
+ argv_array_push(&cmd->args, "for-each-ref");
+ argv_array_push(&cmd->args, "--format=%(objectname)");
+ }
+
cmd->env = local_repo_env;
cmd->out = -1;
}