Fix git dir matching

Match by base of file, if pattern is not
"dir" pattern, ie. trailing slash:

- ✓ "node_modules"  ~ "node_modules/"
- ✗ "node_modules/" ~ "node_modules"
- ✓ "node_modules"  ~ "node_modules"