Skip to content

Commit e73bc54

Browse files
h3rmanjs0
authored andcommitted
fix: check isIgnored first
1 parent bd31534 commit e73bc54

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/git.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,6 @@ export const commitChangesFromRepo = async ({
4040
dir: repoDirectory,
4141
trees,
4242
map: async (filepath, [commit, workdir]) => {
43-
const prevOid = await commit?.oid();
44-
const currentOid = await workdir?.oid();
45-
// Don't include files that haven't changed, and exist in both trees
46-
if (prevOid === currentOid && !commit === !workdir) {
47-
return null;
48-
}
4943
// Don't include ignored files
5044
if (
5145
await git.isIgnored({
@@ -56,6 +50,12 @@ export const commitChangesFromRepo = async ({
5650
) {
5751
return null;
5852
}
53+
const prevOid = await commit?.oid();
54+
const currentOid = await workdir?.oid();
55+
// Don't include files that haven't changed, and exist in both trees
56+
if (prevOid === currentOid && !commit === !workdir) {
57+
return null;
58+
}
5959
// Iterate through anything that may be a directory in either the
6060
// current commit or the working directory
6161
if (

0 commit comments

Comments
 (0)