libgit2/libgit2 — Issue #532: cannot look at attributes for nonexistent files
Author: peff
Created: 2012-01-11 23:18:36+00:00
State: open

The attribute code calls git_path_prettify on the path component provided by the caller. In turn, this calls realpath() on the path, which will fail if the file does not actually exist. Upstream git will happily report the attributes whether or not the file exists.

I ran across this because the upstream git test suite constructs gitattributes files without making the related files in the filesystem. But I believe it would also be a problem for any bare repository (which won't have .gitattributes files, but should still respect $GIT_DIR/info/attributes).

/cc @arrbee