Skip to content

Commit

Permalink
Merge pull request #80 from npm/isaacs/unpack-no-mtime
Browse files Browse the repository at this point in the history
fix: do not set mtime when unpacking
  • Loading branch information
lukekarrys committed Jul 2, 2021
2 parents 7660b0b + 2ed5b64 commit ac56329
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/fetcher.js
Expand Up @@ -437,6 +437,7 @@ class FetcherBase {
return {
cwd,
noChmod: true,
noMtime: true,
filter: (name, entry) => {
if (/Link$/.test(entry.type))
return false
Expand Down
13 changes: 13 additions & 0 deletions test/fetcher.js
Expand Up @@ -14,6 +14,19 @@ if (fakeSudo) {
fs.lchown = fakeChown('lchown')
}

fs.utimes = () => {
throw new Error('do not call utimes')
}
fs.futimes = () => {
throw new Error('do not call futimes')
}
fs.utimesSync = () => {
throw new Error('do not call utimesSync')
}
fs.futimesSync = () => {
throw new Error('do not call futimesSync')
}

const { relative, resolve, basename } = require('path')
const t = require('tap')
const me = t.testdir()
Expand Down

0 comments on commit ac56329

Please sign in to comment.