helper->git_cmd = 0;
helper->silent_exec_failure = 1;
- argv_array_pushf(&helper->env_array, "%s=%s", GIT_DIR_ENVIRONMENT,
- get_git_dir());
+ if (have_git_dir())
+ argv_array_pushf(&helper->env_array, "%s=%s",
+ GIT_DIR_ENVIRONMENT, get_git_dir());
code = start_command(helper);
if (code < 0 && errno == ENOENT)
static void standard_options(struct transport *t)
{
char buf[16];
- int n;
int v = t->verbose;
set_helper_option(t, "progress", t->progress ? "true" : "false");
- n = snprintf(buf, sizeof(buf), "%d", v + 1);
- if (n >= sizeof(buf))
- die("impossibly large verbosity value");
+ xsnprintf(buf, sizeof(buf), "%d", v + 1);
set_helper_option(t, "verbosity", buf);
switch (t->family) {