@matheusbsbs / matheus-bagliano / commits / aa0945701e
Fork 0

Print RUNTIME_PREFIX warning only when GIT_TRACE is set

When RUNTIME_PREFIX is enabled, the installation prefix is derived by trying a limited set of known locations where the git executable can reside. If none of these is found, a warning is emitted. When git is built in a directory that matches neither of these known names, the warning would always be emitted when the uninstalled executable is run. This is a problem on Windows, where gitk picks the uninstalled git when invoked from the build directory and gets confused by the warning. Print the warning only when GIT_TRACE is set. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Johannes Sixt committed Feb 23, 2010 at 12:42 UTC aa0945701e39cf099ca9c28f79e239359781e4f6
1 file changed +1 -1
exec_cmd.c
+1 -1
@@ -28,7 +28,7 @@ const char *system_path(const char *path)
28 !(prefix = strip_path_suffix(argv0_path, BINDIR)) &&
29 !(prefix = strip_path_suffix(argv0_path, "git"))) {
30 prefix = PREFIX;
31 - fprintf(stderr, "RUNTIME_PREFIX requested, "
31 + trace_printf("RUNTIME_PREFIX requested, "
32 "but prefix computation failed. "
33 "Using static fallback '%s'.\n", prefix);
34 }