push.default doc: explain simple after upstream
[gitweb.git] / exec_cmd.c
index 408e4e55e1c58931444c772d35d23b505bf3e2ea..125fa6fabf503d29cb82b2ccbc92359abf95b0e8 100644 (file)
@@ -3,7 +3,6 @@
 #include "quote.h"
 #define MAX_ARGS       32
 
-extern char **environ;
 static const char *argv_exec_path;
 static const char *argv0_path;
 
@@ -28,7 +27,7 @@ const char *system_path(const char *path)
            !(prefix = strip_path_suffix(argv0_path, BINDIR)) &&
            !(prefix = strip_path_suffix(argv0_path, "git"))) {
                prefix = PREFIX;
-               fprintf(stderr, "RUNTIME_PREFIX requested, "
+               trace_printf("RUNTIME_PREFIX requested, "
                                "but prefix computation failed.  "
                                "Using static fallback '%s'.\n", prefix);
        }
@@ -90,7 +89,7 @@ static void add_path(struct strbuf *out, const char *path)
                if (is_absolute_path(path))
                        strbuf_addstr(out, path);
                else
-                       strbuf_addstr(out, make_nonrelative_path(path));
+                       strbuf_addstr(out, absolute_path(path));
 
                strbuf_addch(out, PATH_SEP);
        }
@@ -107,7 +106,7 @@ void setup_path(void)
        if (old_path)
                strbuf_addstr(&new_path, old_path);
        else
-               strbuf_addstr(&new_path, "/usr/local/bin:/usr/bin:/bin");
+               strbuf_addstr(&new_path, _PATH_DEFPATH);
 
        setenv("PATH", new_path.buf, 1);
 
@@ -135,7 +134,7 @@ int execv_git_cmd(const char **argv) {
        trace_argv_printf(nargv, "trace: exec:");
 
        /* execvp() can only ever return if it fails */
-       execvp("git", (char **)nargv);
+       sane_execvp("git", (char **)nargv);
 
        trace_printf("trace: exec failed: %s\n", strerror(errno));