File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -64,10 +64,10 @@ export const findAndParseGitignores = async (cwd: string) => {
64
64
return false ;
65
65
} ;
66
66
67
- const addFile = ( filePath : string ) => {
67
+ const addFile = ( filePath : string , baseDir ?: string ) => {
68
68
gitignoreFiles . push ( relative ( cwd , filePath ) ) ;
69
69
70
- const dir = dirname ( toPosix ( filePath ) ) ;
70
+ const dir = baseDir ?? dirname ( toPosix ( filePath ) ) ;
71
71
const base = relative ( cwd , dir ) ;
72
72
const ancestor = base . startsWith ( '..' ) ? `${ relative ( dir , cwd ) } /` : undefined ;
73
73
@@ -126,7 +126,7 @@ export const findAndParseGitignores = async (cwd: string) => {
126
126
127
127
findAncestorGitignoreFiles ( cwd ) . forEach ( addFile ) ;
128
128
129
- if ( isFile ( '.git/info/exclude' ) ) addFile ( '.git/info/exclude' ) ;
129
+ if ( isFile ( '.git/info/exclude' ) ) addFile ( '.git/info/exclude' , cwd ) ;
130
130
131
131
const entryFilter = ( entry : Entry ) => {
132
132
if ( entry . dirent . isFile ( ) && entry . name === '.gitignore' ) {
You can’t perform that action at this time.
0 commit comments