@@ -20,7 +20,7 @@ async function scanDiff({
2020
2121 const diffSummary = await git . diffSummary ( [ `${ commitSha } ^..${ commitSha } ` ] ) ;
2222
23- const changedFiles1 = diffSummary . files
23+ const changedFiles = diffSummary . files
2424 . map ( file => file . file )
2525 . filter ( file => fileExtensions . some ( ext => file . endsWith ( ext ) ) )
2626 . filter ( file => ! excludePatterns . some ( pattern => {
@@ -33,35 +33,35 @@ async function scanDiff({
3333 } ) )
3434 . map ( file => path . resolve ( repoPath , file ) ) ;
3535
36- console . log ( `Found ${ changedFiles1 . length } changed files in commit ${ commitSha } ` ) ;
36+ console . log ( `Found ${ changedFiles . length } changed files in commit ${ commitSha } ` ) ;
3737
3838
3939 // Отримуємо змінені файли з останнього коміту
4040 const status = await git . status ( ) ;
41-
42- console . log ( `git status ${ status . current } ` )
43- console . log ( `git files count ${ status . files . length } ` )
44- console . log ( `git created ${ status . created . length } ` )
45- console . log ( `git modified ${ status . modified . length } ` )
46- console . log ( `git renamed ${ status . renamed . length } ` )
41+ //
42+ // console.log(`git status ${status.current}`)
43+ // console.log(`git files count ${status.files.length}`)
44+ // console.log(`git created ${status.created.length}`)
45+ // console.log(`git modified ${status.modified.length}`)
46+ // console.log(`git renamed ${status.renamed.length}`)
4747
4848 // Збираємо файли, які були змінені
49- const changedFiles = [
50- ...status . modified ,
51- ...status . created ,
52- ...status . renamed . map ( file => file . to )
53- ]
54- . filter ( file => fileExtensions . some ( ext => file . endsWith ( ext ) ) )
55- . filter ( file => ! excludePatterns . some ( pattern => {
56- // Конвертуємо glob паттерн у регулярний вираз
57- const regexPattern = pattern
58- . replace ( / \* \* / g, '.*' )
59- . replace ( / \* / g, '[^/]*' )
60- . replace ( / \? / g, '[^/]' ) ;
61-
62- return new RegExp ( `^${ regexPattern } $` ) . test ( file ) ;
63- } ) )
64- . map ( file => path . resolve ( repoPath , file ) ) ;
49+ // const changedFiles = [
50+ // ...status.modified,
51+ // ...status.created,
52+ // ...status.renamed.map(file => file.to)
53+ // ]
54+ // .filter(file => fileExtensions.some(ext => file.endsWith(ext)))
55+ // .filter(file => !excludePatterns.some(pattern => {
56+ // // Конвертуємо glob паттерн у регулярний вираз
57+ // const regexPattern = pattern
58+ // .replace(/\*\*/g, '.*')
59+ // .replace(/\*/g, '[^/]*')
60+ // .replace(/\?/g, '[^/]');
61+ //
62+ // return new RegExp(`^${regexPattern}$`).test(file);
63+ // }))
64+ // .map(file => path.resolve(repoPath, file));
6565
6666 // Видалені файли
6767 const deletedFiles = status . deleted
@@ -71,7 +71,7 @@ async function scanDiff({
7171 . replace ( / \* \* / g, '.*' )
7272 . replace ( / \* / g, '[^/]*' )
7373 . replace ( / \? / g, '[^/]' ) ;
74-
74+
7575 return new RegExp ( `^${ regexPattern } $` ) . test ( file ) ;
7676 } ) ) ;
7777
0 commit comments