summaryrefslogtreecommitdiff
path: root/src/ignore.c
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2021-04-04 19:59:57 +0100
committerEdward Thomson <ethomson@edwardthomson.com>2021-04-28 13:03:34 +0100
commit9fb755d561e149b81950c7cc7d8cb5131b24079b (patch)
treee242de6ecdd0e2a5ce3d00aab2debef535063a4f /src/ignore.c
parente52c2989fb6911ef74cccd87a57bffd884842d36 (diff)
downloadlibgit2-9fb755d561e149b81950c7cc7d8cb5131b24079b.tar.gz
attr: validate workdir paths for attribute files
We should allow attribute files - inside working directories - to have names longer than MAX_PATH when core.longpaths is set. `git_attr_path__init` takes a repository to validate the path with.
Diffstat (limited to 'src/ignore.c')
-rw-r--r--src/ignore.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ignore.c b/src/ignore.c
index 27a650b1b..085b0e981 100644
--- a/src/ignore.c
+++ b/src/ignore.c
@@ -453,7 +453,7 @@ int git_ignore__lookup(
*out = GIT_IGNORE_NOTFOUND;
if (git_attr_path__init(
- &path, pathname, git_repository_workdir(ignores->repo), dir_flag) < 0)
+ &path, ignores->repo, pathname, git_repository_workdir(ignores->repo), dir_flag) < 0)
return -1;
/* first process builtins - success means path was found */
@@ -537,7 +537,7 @@ int git_ignore_path_is_ignored(
else if (git_repository_is_bare(repo))
dir_flag = GIT_DIR_FLAG_FALSE;
- if ((error = git_attr_path__init(&path, pathname, workdir, dir_flag)) < 0 ||
+ if ((error = git_attr_path__init(&path, repo, pathname, workdir, dir_flag)) < 0 ||
(error = git_ignore__for_path(repo, path.path, &ignores)) < 0)
goto cleanup;