summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2021-09-24 17:00:43 -0400
committerEdward Thomson <ethomson@edwardthomson.com>2021-09-25 14:39:01 +0100
commit091bd738d79d5485936578ed2cb7edb96efbc80f (patch)
treec1f482fff18fb16823902cefeae5668ba8eaa15c
parent3d8749d323380d47aad7afaa64bf0999dd3992b3 (diff)
downloadlibgit2-ethomson/attr_lookups.tar.gz
attr: ensure lookups are on repo-relative pathsethomson/attr_lookups
Attribute lookups are done on paths relative to the repository. Fail if erroneously presented with an absolute path.
-rw-r--r--src/attr.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/attr.c b/src/attr.c
index 14eab5b46..cd704a490 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;