Skip to content

Commit 091bd73

Browse files
committed
attr: ensure lookups are on repo-relative paths
Attribute lookups are done on paths relative to the repository. Fail if erroneously presented with an absolute path.
1 parent 3d8749d commit 091bd73

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/attr.c

+2
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,8 @@ static int collect_attr_files(
629629
const char *workdir = git_repository_workdir(repo);
630630
attr_walk_up_info info = { NULL };
631631

632+
GIT_ASSERT(!git_path_is_absolute(path));
633+
632634
if ((error = attr_setup(repo, attr_session, opts)) < 0)
633635
return error;
634636

0 commit comments

Comments
 (0)