Skip to content

Commit

Permalink
Only track previously seen hardlinks
Browse files Browse the repository at this point in the history
  • Loading branch information
BRKurek committed Apr 27, 2019
1 parent 4f85851 commit 15e59f1
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function Parse () {
me._stream = new BlockStream(512)
me.position = 0
me._ended = false
me._entries = []
me._hardLinks = []

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

if (entry.type === "File") {
this._entries.forEach(function(prevEntry) {
if (prevEntry.type === "Link" && prevEntry.path === entry.path) {
this._hardLinks.forEach(function(link) {
if (link.path === entry.path) {
ev = "ignoredEntry"
}
})
}

this._entry = entry
this._entries.push(entry)

if (entry.type === "Link") {
this._hardLinks.push(entry)
}

var me = this

entry.on("pause", function () {
Expand Down

0 comments on commit 15e59f1

Please # to comment.