Skip to content
12 changes: 6 additions & 6 deletions src/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ export const commitChangesFromRepo = async ({
) {
return null;
}
const prevOid = await commit?.oid();
const currentOid = await workdir?.oid();
// Don't include files that haven't changed, and exist in both trees
if (prevOid === currentOid && !commit === !workdir) {
return null;
}
if (
(await commit?.mode()) === FILE_MODES.symlink ||
(await workdir?.mode()) === FILE_MODES.symlink
Expand All @@ -87,12 +93,6 @@ export const commitChangesFromRepo = async ({
`Unexpected executable file at ${filepath}, GitHub API only supports non-executable files and directories. You may need to add this file to .gitignore`,
);
}
const prevOid = await commit?.oid();
const currentOid = await workdir?.oid();
// Don't include files that haven't changed, and exist in both trees
if (prevOid === currentOid && !commit === !workdir) {
return null;
}
// Iterate through anything that may be a directory in either the
// current commit or the working directory
if (
Expand Down
Loading