Merge branch 'pc/occurred'
authorJunio C Hamano <gitster@pobox.com>
Mon, 27 Jun 2016 16:56:42 +0000 (09:56 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 27 Jun 2016 16:56:42 +0000 (09:56 -0700)
* pc/occurred:
config.c: fix misspelt "occurred" in an error message
refs.h: fix misspelt "occurred" in a comment

1  2 
config.c
diff --combined config.c
index f51c56bf92d384ace98e580c510842bd7eab9871,f4b6454bba26d19ac7d1b07ebd82bb38a56e0c67..d7ce34b33d67c38245e77b7082d80f350e4f7eb7
+++ 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;
                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;
                }
                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;
                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;
                }
        }
  
        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;
        }
  
        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;