Skip to content

Commit 4e9494c

Browse files
authored
Merge pull request #79 from SlyBouhafs/FixDeletedFiles
This PR adds a filter to the diff command to ignore deleted files from showing in the diff.
2 parents 897e602 + 7e18cf6 commit 4e9494c

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "c0d3",
3-
"version": "2.3.4",
3+
"version": "2.3.5",
44
"description": "Command Line Interface (CLI) for c0d3.com",
55
"license": "MIT",
66
"homepage": "https://c0d3.com",

src/util/git.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ export const getDiffAgainstMaster = async (
134134

135135
const changedFilesString = await git.diff([
136136
`master..${current}`,
137+
'--diff-filter=d',
137138
'--name-only',
138139
...ignoreFileOptions,
139140
])
@@ -148,8 +149,13 @@ export const getDiffAgainstMaster = async (
148149
validateFiles(changedFilesString, lessonOrder, challengeOrder.toString())
149150

150151
const [display, db] = await Promise.all([
151-
git.diff([`--color`, `master..${current}`, ...ignoreFileOptions]),
152-
git.diff([`master..${current}`, ...ignoreFileOptions]),
152+
git.diff([
153+
`--color`,
154+
`master..${current}`,
155+
'--diff-filter=d',
156+
...ignoreFileOptions,
157+
]),
158+
git.diff([`master..${current}`, '--diff-filter=d', ...ignoreFileOptions]),
153159
])
154160

155161
return {

0 commit comments

Comments
 (0)