Skip to content

Commit 70694e8

Browse files
committed
fix(git): force files deletion since environment differences make a fresh cloned repo to have changes directly (no way to prevent this)
1 parent f3bd4ad commit 70694e8

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/features/initiative.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1028,7 +1028,15 @@ export async function feedInitiativesFromDatabase() {
10281028
const filesToDeleteFilePath = path.resolve(codeFolderPath, `./.git/.filestodelete`);
10291029

10301030
await fs.writeFile(filesToDeleteFilePath, filesToRemove.join('\n'));
1031-
await projectGit.raw(['rm', '--pathspec-from-file', filesToDeleteFilePath]);
1031+
await projectGit.raw([
1032+
'rm',
1033+
'--pathspec-from-file',
1034+
filesToDeleteFilePath,
1035+
// Some repositories have a diff on binary files (like PDFs) just after cloning which prevents deletion
1036+
// We thought it came from CRLF or binary settings, but despite trying the config properties `core.autocrlf=false` and `core.fileMode=false` nothing has changed
1037+
// So just forcing the deletion (example having this issue: https://github.com/mission-apprentissage/mission.apprentissage)
1038+
'--force',
1039+
]);
10321040
}
10331041
}
10341042

0 commit comments

Comments
 (0)