File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,25 @@ async function scanDiff({
1717 console . log ( `commitSha ${ commitSha } ` ) ;
1818
1919 const git = simpleGit ( repoPath ) ;
20-
20+
21+ const diffSummary = await git . diffSummary ( [ `${ commitSha } ^..${ commitSha } ` ] ) ;
22+
23+ const changedFiles1 = diffSummary . files
24+ . map ( file => file . file )
25+ . filter ( file => fileExtensions . some ( ext => file . endsWith ( ext ) ) )
26+ . filter ( file => ! excludePatterns . some ( pattern => {
27+ const regexPattern = pattern
28+ . replace ( / \* \* / g, '.*' )
29+ . replace ( / \* / g, '[^/]*' )
30+ . replace ( / \? / g, '[^/]' ) ;
31+
32+ return new RegExp ( `^${ regexPattern } $` ) . test ( file ) ;
33+ } ) )
34+ . map ( file => path . resolve ( repoPath , file ) ) ;
35+
36+ console . log ( `Found ${ changedFiles1 . length } changed files in commit ${ commitSha } ` ) ;
37+
38+
2139 // Отримуємо змінені файли з останнього коміту
2240 const status = await git . status ( ) ;
2341
You can’t perform that action at this time.
0 commit comments