From: Junio C Hamano Date: Wed, 6 Jul 2016 20:06:43 +0000 (-0700) Subject: Merge branch 'pc/occurred' into maint X-Git-Tag: v2.9.1~21 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/9d3d0dbb14fa529492d828485b1f65aa9e0ed199?ds=inline;hp=-c Merge branch 'pc/occurred' into maint Typofix. * pc/occurred: config.c: fix misspelt "occurred" in an error message refs.h: fix misspelt "occurred" in a comment --- 9d3d0dbb14fa529492d828485b1f65aa9e0ed199 diff --combined config.c index f51c56bf92,f4b6454bba..d7ce34b33d --- a/config.c +++ b/config.c @@@ -162,7 -162,7 +162,7 @@@ void git_config_push_parameter(const ch { struct strbuf env = STRBUF_INIT; const char *old = getenv(CONFIG_DATA_ENVIRONMENT); - if (old) { + if (old && *old) { strbuf_addstr(&env, old); strbuf_addch(&env, ' '); } @@@ -717,9 -717,6 +717,9 @@@ static int git_default_core_config(cons if (!strcmp(var, "core.attributesfile")) return git_config_pathname(&git_attributes_file, var, value); + if (!strcmp(var, "core.hookspath")) + return git_config_pathname(&git_hooks_path, var, value); + if (!strcmp(var, "core.bare")) { is_bare_repository_cfg = git_config_bool(var, value); return 0; @@@ -1281,7 -1278,7 +1281,7 @@@ static void git_config_raw(config_fn_t * something went really wrong and we should stop * immediately. */ - die(_("unknown error occured while reading the configuration files")); + die(_("unknown error occurred while reading the configuration files")); } static void configset_iter(struct config_set *cs, config_fn_t fn, void *data) @@@ -2016,7 -2013,7 +2016,7 @@@ int git_config_set_multivar_in_file_gen lock = xcalloc(1, sizeof(struct lock_file)); fd = hold_lock_file_for_update(lock, config_filename, 0); if (fd < 0) { - error("could not lock config file %s: %s", config_filename, strerror(errno)); + error_errno("could not lock config file %s", config_filename); free(store.key); ret = CONFIG_NO_LOCK; goto out_free; @@@ -2030,7 -2027,8 +2030,7 @@@ free(store.key); if ( ENOENT != errno ) { - error("opening %s: %s", config_filename, - strerror(errno)); + error_errno("opening %s", config_filename); ret = CONFIG_INVALID_FILE; /* same as "invalid config file" */ goto out_free; } @@@ -2114,7 -2112,8 +2114,7 @@@ if (contents == MAP_FAILED) { if (errno == ENODEV && S_ISDIR(st.st_mode)) errno = EISDIR; - error("unable to mmap '%s': %s", - config_filename, strerror(errno)); + error_errno("unable to mmap '%s'", config_filename); ret = CONFIG_INVALID_FILE; contents = NULL; goto out_free; @@@ -2123,7 -2122,8 +2123,7 @@@ in_fd = -1; if (chmod(get_lock_file_path(lock), st.st_mode & 07777) < 0) { - error("chmod on %s failed: %s", - get_lock_file_path(lock), strerror(errno)); + error_errno("chmod on %s failed", get_lock_file_path(lock)); ret = CONFIG_NO_WRITE; goto out_free; } @@@ -2179,7 -2179,8 +2179,7 @@@ } if (commit_lock_file(lock) < 0) { - error("could not write config file %s: %s", config_filename, - strerror(errno)); + error_errno("could not write config file %s", config_filename); ret = CONFIG_NO_WRITE; lock = NULL; goto out_free; @@@ -2330,8 -2331,8 +2330,8 @@@ int git_config_rename_section_in_file(c fstat(fileno(config_file), &st); if (chmod(get_lock_file_path(lock), st.st_mode & 07777) < 0) { - ret = error("chmod on %s failed: %s", - get_lock_file_path(lock), strerror(errno)); + ret = error_errno("chmod on %s failed", + get_lock_file_path(lock)); goto out; } @@@ -2385,8 -2386,8 +2385,8 @@@ fclose(config_file); unlock_and_out: if (commit_lock_file(lock) < 0) - ret = error("could not write config file %s: %s", - config_filename, strerror(errno)); + ret = error_errno("could not write config file %s", + config_filename); out: free(filename_buf); return ret;