Skip to contentSkip to conversation

git_connect: use use_shell instead of explicit "sh", "-c"

PATCH In review Johannes Sixt 2 participants 2 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 git_connect: use use_shell instead of explicit "sh", "-c"

From: Johannes Sixt <[email protected]>

This is a followup to ac0ba18 (run-command: convert simple callsites to use_shell, 2009-12-30), for consistency.

---
Jeff,

is there a reason that this was not part of the original patch?

-- Hannes

 connect.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
connect.c +0 -0
index db965c9..3a12562 100644
@@ -613,8 +613,7 @@ struct child_process *git_connect(int fd[2], const

char *url_orig,
NULL
};
conn->env = env;
- *arg++ = "sh";
- *arg++ = "-c";
+ conn->use_shell = 1;
}
*arg++ = cmd.buf;
*arg = NULL;

Signature · 1 line
1.7.0.rc0.39.g31c5d
#1 lore raw
Quoted 8 lines · Johannes Sixt

This is a followup to ac0ba18 (run-command: convert simple callsites to use_shell, 2009-12-30), for consistency.

---
Jeff,

is there a reason that this was not part of the original patch?

No, I must have just missed it (I don't remember omitting it for a particular reason at the time, and after looking at it now, it looks sane to me).

After this, git grep '"sh"' turns up only two uses: one in the run-command code use_shell code path, and the other in builtin-help.c. The one in builtin-help is hard to change, as it relies on direct exec instead of run-command.

-Peff