Skip to content

Commit

Permalink
Merge pull request #79 from SlyBouhafs/FixDeletedFiles
Browse files Browse the repository at this point in the history
This PR adds a filter to the diff command to ignore deleted files from showing in the diff.
  • Loading branch information
SlyBouhafs authored Oct 8, 2023
2 parents 897e602 + 7e18cf6 commit 4e9494c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "c0d3",
"version": "2.3.4",
"version": "2.3.5",
"description": "Command Line Interface (CLI) for c0d3.com",
"license": "MIT",
"homepage": "https://c0d3.com",
Expand Down
10 changes: 8 additions & 2 deletions src/util/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ export const getDiffAgainstMaster = async (

const changedFilesString = await git.diff([
`master..${current}`,
'--diff-filter=d',
'--name-only',
...ignoreFileOptions,
])
Expand All @@ -148,8 +149,13 @@ export const getDiffAgainstMaster = async (
validateFiles(changedFilesString, lessonOrder, challengeOrder.toString())

const [display, db] = await Promise.all([
git.diff([`--color`, `master..${current}`, ...ignoreFileOptions]),
git.diff([`master..${current}`, ...ignoreFileOptions]),
git.diff([
`--color`,
`master..${current}`,
'--diff-filter=d',
...ignoreFileOptions,
]),
git.diff([`master..${current}`, '--diff-filter=d', ...ignoreFileOptions]),
])

return {
Expand Down

0 comments on commit 4e9494c

Please sign in to comment.