`npm pack` includes items from `.git` folder if there is a branch called `readme` (regression in 6.9.0)


(Dominykas Blyžė) #1

What I Wanted to Do

$ git branch readme
$ npm pack

What Happened Instead

14:01 $ npm pack
[..snip..]
npm notice === Tarball Contents === 
[..snip..]
npm notice 169B   .git/logs/refs/heads/readme   
npm notice 41B    .git/refs/heads/readme        
[..snip..]

Reproduction Steps

(same as “What I wanted to do”)

Platform Info

14:02 $ npm --versions
{ '@my-namespace/my-package: '4.16.0',
  npm: '6.9.0',
  ares: '1.15.0',
  cldr: '33.1',
  http_parser: '2.8.0',
  icu: '62.1',
  modules: '64',
  napi: '3',
  nghttp2: '1.34.0',
  node: '10.15.3',
  openssl: '1.1.0j',
  tz: '2018e',
  unicode: '11.0',
  uv: '1.23.2',
  v8: '6.8.275.32-node.51',
  zlib: '1.2.11' }
14:03 $ node -p process.platform
darwin

This is causing issues if such a package is installed as a dep, and then npm prune --production is run, as it starts to complain about EISGIT.