Skip to content

Commit 15e59f1

Browse files
committed
Only track previously seen hardlinks
1 parent 4f85851 commit 15e59f1

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

lib/parse.js

+8-4
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ function Parse () {
3838
me._stream = new BlockStream(512)
3939
me.position = 0
4040
me._ended = false
41-
me._entries = []
41+
me._hardLinks = []
4242

4343
me._stream.on("error", function (e) {
4444
me.emit("error", e)
@@ -252,15 +252,19 @@ Parse.prototype._startEntry = function (c) {
252252
if (onend) entry.on("end", onend)
253253

254254
if (entry.type === "File") {
255-
this._entries.forEach(function(prevEntry) {
256-
if (prevEntry.type === "Link" && prevEntry.path === entry.path) {
255+
this._hardLinks.forEach(function(link) {
256+
if (link.path === entry.path) {
257257
ev = "ignoredEntry"
258258
}
259259
})
260260
}
261261

262262
this._entry = entry
263-
this._entries.push(entry)
263+
264+
if (entry.type === "Link") {
265+
this._hardLinks.push(entry)
266+
}
267+
264268
var me = this
265269

266270
entry.on("pause", function () {

0 commit comments

Comments
 (0)