@@ -96,19 +96,25 @@ class GitService {
9696 window . showInformationMessage ( `${ CONSTANTS . extensionShortName } : ${ msg } ` ) ;
9797 }
9898
99- async getDiffAndWarnUser ( repo : Repository , cached = true , nameOnly ?: boolean ) {
99+ async getDiffAndWarnUser ( repo : Repository , cached = true , nameOnly ?: boolean , silent = false ) {
100100 const diff = await this . getGitDiff ( repo , cached , nameOnly ) ;
101101 if ( ! diff ) {
102102 if ( cached ) {
103103 const diffUncached = await repo . diff ( false ) ;
104104 if ( diffUncached ) {
105- this . showInformationMessage ( "warning: please stage your git changes" ) ;
105+ if ( ! silent ) {
106+ this . showInformationMessage ( "warning: please stage your git changes" ) ;
107+ }
106108 } else {
107- this . showInformationMessage ( "No Changes" ) ;
109+ if ( ! silent ) {
110+ this . showInformationMessage ( "No Changes" ) ;
111+ }
108112 }
109113 return null ;
110114 }
111- this . showInformationMessage ( "No changes" ) ;
115+ if ( ! silent ) {
116+ this . showInformationMessage ( "No changes" ) ;
117+ }
112118 }
113119 return diff ;
114120 }
@@ -124,7 +130,11 @@ class GitService {
124130 // Simple glob pattern matching
125131 if ( pattern . includes ( "*" ) ) {
126132 const regex = new RegExp (
127- `^${ pattern . replace ( / \\ / g, "\\\\" ) . replace ( / \. / g, "\\." ) . replace ( / \* / g, ".*" ) . replace ( / \? / g, "." ) } $` ,
133+ `^${ pattern
134+ . replace ( / \\ / g, "\\\\" )
135+ . replace ( / \. / g, "\\." )
136+ . replace ( / \* / g, ".*" )
137+ . replace ( / \? / g, "." ) } $`,
128138 ) ;
129139 if ( regex . test ( filePath ) ) {
130140 return true ;
0 commit comments