Skip to content

Commit e18d89a

Browse files
authored
Don't error on symlinks and executables when they don't have to be touched anyway
1 parent 3d63783 commit e18d89a

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
@@ -74,6 +74,12 @@ export const commitChangesFromRepo = async ({
7474
) {
7575
return null;
7676
}
77+
const prevOid = await commit?.oid();
78+
const currentOid = await workdir?.oid();
79+
// Don't include files that haven't changed, and exist in both trees
80+
if (prevOid === currentOid && !commit === !workdir) {
81+
return null;
82+
}
7783
if (
7884
(await commit?.mode()) === FILE_MODES.symlink ||
7985
(await workdir?.mode()) === FILE_MODES.symlink
@@ -87,12 +93,6 @@ export const commitChangesFromRepo = async ({
8793
`Unexpected executable file at ${filepath}, GitHub API only supports non-executable files and directories. You may need to add this file to .gitignore`,
8894
);
8995
}
90-
const prevOid = await commit?.oid();
91-
const currentOid = await workdir?.oid();
92-
// Don't include files that haven't changed, and exist in both trees
93-
if (prevOid === currentOid && !commit === !workdir) {
94-
return null;
95-
}
9696
// Iterate through anything that may be a directory in either the
9797
// current commit or the working directory
9898
if (

0 commit comments

Comments
 (0)