X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=config.c;h=b6d789a189713a0259e3f8eb0e29ef657cde66c7;hb=97f261b1e7f1af54aed700e61cdb8af74dbd2459;hp=a9e23594bd18b1cde49b55a40b2af8e2f3b74439;hpb=7ed72d1813e570f21259f3576fde0cc62b6de888;p=git.git diff --git a/config.c b/config.c index a9e23594b..b6d789a18 100644 --- a/config.c +++ b/config.c @@ -491,6 +491,9 @@ static int git_default_core_config(const char *var, const char *value) return 0; } + if (!strcmp(var, "core.attributesfile")) + return git_config_pathname(&git_attributes_file, var, value); + if (!strcmp(var, "core.bare")) { is_bare_repository_cfg = git_config_bool(var, value); return 0; @@ -862,12 +865,12 @@ int git_config_early(config_fn_t fn, void *data, const char *repo_config) home = getenv("HOME"); if (home) { - char *user_config = xstrdup(mkpath("%s/.gitconfig", home)); + char buf[PATH_MAX]; + char *user_config = mksnpath(buf, sizeof(buf), "%s/.gitconfig", home); if (!access(user_config, R_OK)) { ret += git_config_from_file(fn, user_config, data); found += 1; } - free(user_config); } if (repo_config && !access(repo_config, R_OK)) {