Merge branch 'mk/color'
[gitweb.git] / var.c
diff --git a/var.c b/var.c
index 4127031910c83987c8ef394e3711942e2db8a8f9..c20ac919bdbe73c8cd7657d468d2dfbccf6d3aa2 100644 (file)
--- a/var.c
+++ b/var.c
@@ -21,7 +21,7 @@ static void list_vars(void)
 {
        struct git_var *ptr;
        for(ptr = git_vars; ptr->read; ptr++) {
-               printf("%s=%s\n", ptr->name, ptr->read(0));
+               printf("%s=%s\n", ptr->name, ptr->read(IDENT_WARN_ON_NO_NAME));
        }
 }
 
@@ -32,7 +32,7 @@ static const char *read_var(const char *var)
        val = NULL;
        for(ptr = git_vars; ptr->read; ptr++) {
                if (strcmp(var, ptr->name) == 0) {
-                       val = ptr->read(1);
+                       val = ptr->read(IDENT_ERROR_ON_NO_NAME);
                        break;
                }
        }
@@ -51,11 +51,12 @@ static int show_config(const char *var, const char *value)
 int main(int argc, char **argv)
 {
        const char *val;
+       int nongit;
        if (argc != 2) {
                usage(var_usage);
        }
 
-       setup_git_directory();
+       setup_git_directory_gently(&nongit);
        val = NULL;
 
        if (strcmp(argv[1], "-l") == 0) {