files-backend: convert git_path() to strbuf_git_path()
[gitweb.git] / transport-helper.c
index 1258d6aedd26538f55c60495a61608236262cfc1..dc90a1fb769c078be2fbf77018242b6fc209acf6 100644 (file)
@@ -124,8 +124,9 @@ static struct child_process *get_helper(struct transport *transport)
        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)