diff options
Diffstat (limited to 'config.c')
-rw-r--r-- | config.c | 17 |
1 files changed, 8 insertions, 9 deletions
@@ -76,7 +76,6 @@ static struct key_value_info *current_config_kvi; */ static enum config_scope current_parsing_scope; -static int core_compression_seen; static int pack_compression_seen; static int zlib_compression_seen; @@ -1400,8 +1399,6 @@ static int git_default_core_config(const char *var, const char *value, void *cb) level = Z_DEFAULT_COMPRESSION; else if (level < 0 || level > Z_BEST_COMPRESSION) die(_("bad zlib compression level %d"), level); - core_compression_level = level; - core_compression_seen = 1; if (!zlib_compression_seen) zlib_compression_level = level; if (!pack_compression_seen) @@ -1833,9 +1830,10 @@ static int git_config_from_blob_ref(config_fn_t fn, char *git_system_config(void) { char *system_config = xstrdup_or_null(getenv("GIT_CONFIG_SYSTEM")); - if (system_config) - return system_config; - return system_path(ETC_GITCONFIG); + if (!system_config) + system_config = system_path(ETC_GITCONFIG); + normalize_path_copy(system_config, system_config); + return system_config; } void git_global_config(char **user_out, char **xdg_out) @@ -2072,7 +2070,7 @@ static int configset_add_value(struct config_set *cs, const char *key, const cha e = xmalloc(sizeof(*e)); hashmap_entry_init(&e->ent, strhash(key)); e->key = xstrdup(key); - string_list_init(&e->value_list, 1); + string_list_init_dup(&e->value_list); hashmap_add(&cs->config_hash, &e->ent); } si = string_list_append_nodup(&e->value_list, xstrdup_or_null(value)); @@ -2837,7 +2835,7 @@ static void maybe_remove_section(struct config_store_data *store, begin = store->parsed[i].begin; /* - * Next, make sure that we are removing he last key(s) in the section, + * Next, make sure that we are removing the last key(s) in the section, * and that there are no comments that are possibly about the current * section. */ @@ -3051,7 +3049,8 @@ int git_config_set_multivar_in_file_gently(const char *config_filename, if (contents == MAP_FAILED) { if (errno == ENODEV && S_ISDIR(st.st_mode)) errno = EISDIR; - error_errno(_("unable to mmap '%s'"), config_filename); + error_errno(_("unable to mmap '%s'%s"), + config_filename, mmap_os_err()); ret = CONFIG_INVALID_FILE; contents = NULL; goto out_free; |