Code

Make GIT_CONFIG only contain the config subcommand
authorJonas Fonseca <fonseca@diku.dk>
Mon, 6 Oct 2008 19:00:58 +0000 (21:00 +0200)
committerJonas Fonseca <fonseca@diku.dk>
Mon, 6 Oct 2008 19:00:58 +0000 (21:00 +0200)
configure.ac
tig.c

index 6b0fc45293092be92f771f36bed28008037da2e7..b179389febd36f351cad70e0cd26e313ecc55a16 100644 (file)
@@ -24,11 +24,11 @@ AM_ICONV
 AC_PROG_CC
 
 AC_CHECK_PROG(GIT, [git], [git], [AC_ERROR([git not found])])
-AC_MSG_CHECKING([which config command git supports])
-GIT_CONFIG="git repo-config"
-git config --list >/dev/null && GIT_CONFIG="git config"
+AC_MSG_CHECKING([which config subcommand git supports])
+GIT_CONFIG="repo-config"
+git config --list >/dev/null && GIT_CONFIG="config"
 AC_MSG_RESULT([$GIT_CONFIG])
-AC_DEFINE_UNQUOTED(GIT_CONFIG,"$GIT_CONFIG",[git config program])
+AC_DEFINE_UNQUOTED(GIT_CONFIG,"$GIT_CONFIG",[git config subcommand])
 
 AC_CHECK_PROGS(ASCIIDOC, [asciidoc false])
 AC_CHECK_PROGS(XMLTO, [xmlto false])
diff --git a/tig.c b/tig.c
index 4f21c3d86edae75ffefa0bebc703fa20fda2e967..25fb237c6b1d39a2563bcf072ebcdd73614920ce 100644 (file)
--- a/tig.c
+++ b/tig.c
@@ -114,7 +114,7 @@ static bool prompt_yesno(const char *prompt);
 #define NULL_ID                "0000000000000000000000000000000000000000"
 
 #ifndef GIT_CONFIG
-#define GIT_CONFIG "git config"
+#define GIT_CONFIG "config"
 #endif
 
 #define TIG_LS_REMOTE \
@@ -5834,7 +5834,7 @@ read_repo_config_option(char *name, size_t namelen, char *value, size_t valuelen
 static int
 load_git_config(void)
 {
-       return read_properties(popen(GIT_CONFIG " --list", "r"),
+       return read_properties(popen("git " GIT_CONFIG " --list", "r"),
                               "=", read_repo_config_option);
 }