Commit f5a9f0a2 by Edward Thomson

attr_file: don't validate workdir paths in attr lookups

When looking up attributes for a file, we construct an absolute path
to the queried file within the working directory so that we can accept
both absolute paths and working directory relative paths.  We then trim
the leading working directory path to give us an in-repo path.

Since we only want the in-repo path to look up attributes - and not to
read it from disk - we don't need to validate its length.
parent 13690108
...@@ -561,8 +561,7 @@ int git_attr_path__init( ...@@ -561,8 +561,7 @@ int git_attr_path__init(
/* build full path as best we can */ /* build full path as best we can */
git_buf_init(&info->full, 0); git_buf_init(&info->full, 0);
if (git_path_join_unrooted(&info->full, path, base, &root) < 0 || if (git_path_join_unrooted(&info->full, path, base, &root) < 0)
git_path_validate_workdir_buf(repo, &info->full) < 0)
return -1; return -1;
info->path = info->full.ptr + root; info->path = info->full.ptr + root;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment