Merge branch 'mp/upload-pack-use-embedded-args' into maint
[gitweb.git] / builtin / config.c
index 8602b216d876e5f68c725bd004350d8bdfe819a5..ca9f834ae648177a67e1c9fea9481dfe58ff3972 100644 (file)
@@ -377,6 +377,9 @@ static int get_colorbool(const char *var, int print)
 
 static void check_write(void)
 {
+       if (!given_config_source.file && !startup_info->have_repository)
+               die("not in a git directory");
+
        if (given_config_source.use_stdin)
                die("writing to stdin is not supported");