Commit e269b343 by Edward Thomson

ignore: only skip first leading slash

For compatibility with git, only skip the first leading slash in an
ignore file.  That is: `/a.txt` indicates to ignore a file named `a.txt`
at the root.  However `//b.txt` does not indicate that a file named
`b.txt` at the root should be ignored.
parent e6e6b60f
......@@ -604,7 +604,8 @@ int git_attr_fnmatch__parse(
if (*scan == '/') {
spec->flags = spec->flags | GIT_ATTR_FNMATCH_FULLPATH;
slash_count++;
if (pattern == scan)
if (slash_count == 1 && pattern == scan)
pattern++;
}
/* remember if we see an unescaped wildcard in pattern */
......
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