File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -228,7 +228,7 @@ function layersWithLatestFileModifications(
228228 // if finding a deleted file - trimming to its original file name for excluding it from extractedLayers
229229 // + not adding this file
230230 if ( isWhitedOutFile ( filename ) ) {
231- removedFilesToIgnore . add ( filename . replace ( / .w h ./ , "" ) ) ;
231+ removedFilesToIgnore . add ( filename . replace ( / \ .w h \ ./ , "" ) ) ;
232232 continue ;
233233 }
234234 // not adding previously found to be whited out files to extractedLayers
@@ -248,8 +248,13 @@ function layersWithLatestFileModifications(
248248 return extractedLayers ;
249249}
250250
251+ /**
252+ * check if a file is 'whited out', which is shown by
253+ * prefixing the filename with a .wh.
254+ * https://www.madebymikal.com/interpreting-whiteout-files-in-docker-image-layers/
255+ */
251256export function isWhitedOutFile ( filename : string ) {
252- return filename . match ( / .w h . / gm ) ;
257+ return / \ .w h \. / . test ( filename ) ;
253258}
254259
255260function isBufferType ( type : FileContent ) : type is Buffer {
You can’t perform that action at this time.
0 commit comments