summaryrefslogtreecommitdiff
path: root/connect.c
diff options
context:
space:
mode:
Diffstat (limited to 'connect.c')
-rw-r--r--connect.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/connect.c b/connect.c
index c0144d859a..962f9904d4 100644
--- a/connect.c
+++ b/connect.c
@@ -721,6 +721,8 @@ struct child_process *git_connect(int fd[2], const char *url,
strbuf_addch(&cmd, ' ');
sq_quote_buf(&cmd, path);
+ /* remove repo-local variables from the environment */
+ conn->env = local_repo_env;
conn->in = conn->out = -1;
if (protocol == PROTO_SSH) {
const char *ssh;
@@ -778,8 +780,6 @@ struct child_process *git_connect(int fd[2], const char *url,
}
argv_array_push(&conn->args, ssh_host);
} else {
- /* remove repo-local variables from the environment */
- conn->env = local_repo_env;
conn->use_shell = 1;
}
argv_array_push(&conn->args, cmd.buf);