Merge branch 'mh/blame-worktree'
[gitweb.git] / builtin / config.c
index 1d7c6ef558bf7adcfb94ea454966667f987f7701..a991a53418506f18f439212f8cfe1f6f994ea571 100644 (file)
@@ -604,7 +604,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)
                                      given_config_source.file : git_path("config"));
                if (use_global_config) {
                        int fd = open(config_file, O_CREAT | O_EXCL | O_WRONLY, 0666);
-                       if (fd) {
+                       if (fd >= 0) {
                                char *content = default_user_config();
                                write_str_in_full(fd, content);
                                free(content);