Commit 091bd738d79d5485936578ed2cb7edb96efbc80f

Edward Thomson 2021-09-24T17:00:43

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
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/attr.c b/src/attr.c
index 14eab5b..cd704a4 100644
--- a/src/attr.c
+++ b/src/attr.c
@@ -629,6 +629,8 @@ static int collect_attr_files(
 	const char *workdir = git_repository_workdir(repo);
 	attr_walk_up_info info = { NULL };
 
+	GIT_ASSERT(!git_path_is_absolute(path));
+
 	if ((error = attr_setup(repo, attr_session, opts)) < 0)
 		return error;