Skip to content

Commit ac56329

Browse files
authoredJul 2, 2021
Merge pull request #80 from npm/isaacs/unpack-no-mtime
fix: do not set mtime when unpacking
2 parents 7660b0b + 2ed5b64 commit ac56329

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed
 

‎lib/fetcher.js

+1
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,7 @@ class FetcherBase {
437437
return {
438438
cwd,
439439
noChmod: true,
440+
noMtime: true,
440441
filter: (name, entry) => {
441442
if (/Link$/.test(entry.type))
442443
return false

‎test/fetcher.js

+13
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,19 @@ if (fakeSudo) {
1414
fs.lchown = fakeChown('lchown')
1515
}
1616

17+
fs.utimes = () => {
18+
throw new Error('do not call utimes')
19+
}
20+
fs.futimes = () => {
21+
throw new Error('do not call futimes')
22+
}
23+
fs.utimesSync = () => {
24+
throw new Error('do not call utimesSync')
25+
}
26+
fs.futimesSync = () => {
27+
throw new Error('do not call futimesSync')
28+
}
29+
1730
const { relative, resolve, basename } = require('path')
1831
const t = require('tap')
1932
const me = t.testdir()

0 commit comments

Comments
 (0)
Please sign in to comment.