Skip to content

Commit 18a6d9f

Browse files
committed
attr: Don't fail in attr_setup if there exists a system attributes file
Regression introduced in commit 5452e49 on PR libgit2#4967. Signed-off-by: Sven Strickroth <email@cs-ware.de>
1 parent c4c1500 commit 18a6d9f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/attr.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,7 @@ static int attr_setup(git_repository *repo, git_attr_session *attr_session)
333333
NULL, git_repository_attr_cache(repo)->cfg_attr_file)) < 0)
334334
goto out;
335335

336+
git_buf_clear(&path); /* git_repository_item_path expects an empty buffer, because it uses git_buf_set */
336337
if ((error = git_repository_item_path(&path, repo, GIT_REPOSITORY_ITEM_INFO)) < 0 ||
337338
(error = preload_attr_file(repo, attr_session, GIT_ATTR_FILE__FROM_FILE,
338339
path.ptr, GIT_ATTR_FILE_INREPO)) < 0) {

0 commit comments

Comments
 (0)