Skip to content

Commit

Permalink
#59: Enabled file deleted feature in Commit.js
Browse files Browse the repository at this point in the history
  • Loading branch information
profjellybean committed Dec 16, 2022
1 parent fb3973a commit cbad856
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/models/Commit.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,11 @@ Commit.prototype.processTree = function (repo, nCommit, currentBranch, urlProvid
changes.push({ lhs: { at: 0, del: 0 }, rhs: { at: 1, add: lineCount } });
} else if (!commitFiles.includes(filepath) && parentCommitFiles.includes(filepath)) {
//file deleted
return;
//return;
//index file deletions as changes
//parentContent = Buffer.from(await parentCommitEntry.content()).toString('utf8');
//const parentLineCount = parentContent.split('\n').length;
//changes.push({ lhs: { at: 0, del: parentLineCount }, rhs: { at: 0, add: 0 } });
parentContent = Buffer.from(await parentCommitEntry.content()).toString('utf8');
const parentLineCount = parentContent.split('\n').length;
changes.push({ lhs: { at: 0, del: parentLineCount }, rhs: { at: 0, add: 0 } });
} else {
//file modified
parentContent = Buffer.from(await parentCommitEntry.content()).toString('utf8');
Expand Down

0 comments on commit cbad856

Please sign in to comment.