make top-level .gitignore only apply to top-level files/directories (#1960)