am: drop "dir" parameter from am_state_init
[gitweb.git] / builtin / config.c
index 05843a0f96e4dc0dbf9fbc7310039794b57947e7..07fcc2388b9755f3d69e86b00c90ced7f73041c7 100644 (file)
@@ -599,8 +599,9 @@ int cmd_config(int argc, const char **argv, const char *prefix)
                if (given_config_source.blob)
                        die("editing blobs is not supported");
                git_config(git_default_config, NULL);
-               config_file = xstrdup(given_config_source.file ?
-                                     given_config_source.file : git_path("config"));
+               config_file = given_config_source.file ?
+                               xstrdup(given_config_source.file) :
+                               git_pathdup("config");
                if (use_global_config) {
                        int fd = open(config_file, O_CREAT | O_EXCL | O_WRONLY, 0666);
                        if (fd >= 0) {