ignore: fix a missing commondir causing failures

As with the preceding commit, the ignore code tries to load code from
info/exclude, and we fail to ignore a non-existent file here.
parent 82c7a9bc
......@@ -335,16 +335,13 @@ int git_ignore__for_path(
goto cleanup;
}
if ((error = git_repository_item_path(&infopath,
repo, GIT_REPOSITORY_ITEM_INFO)) < 0)
goto cleanup;
/* load .git/info/exclude */
error = push_ignore_file(
ignores, &ignores->ign_global,
infopath.ptr, GIT_IGNORE_FILE_INREPO);
if (error < 0)
goto cleanup;
/* load .git/info/exclude if possible */
if ((error = git_repository_item_path(&infopath, repo, GIT_REPOSITORY_ITEM_INFO)) < 0 ||
(error = push_ignore_file(ignores, &ignores->ign_global, infopath.ptr, GIT_IGNORE_FILE_INREPO)) < 0) {
if (error != GIT_ENOTFOUND)
goto cleanup;
error = 0;
}
/* load core.excludesfile */
if (git_repository_attr_cache(repo)->cfg_excl_file != NULL)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment