Filtrar arquivo .git de worktrees no upload de projetos
Worktrees têm .git como arquivo (não pasta), que passava pelo filtro. Adicionado à lista de exclusão no frontend e no backend.
This commit is contained in:
@@ -5,7 +5,7 @@ const ImportUI = {
|
||||
_importing: false,
|
||||
|
||||
_excludedDirs: ['.git', 'node_modules', '__pycache__', '.next', '.nuxt', 'venv', '.venv', '.cache', '.parcel-cache', 'dist', 'build', '.output', '.svelte-kit', 'vendor', 'target', '.gradle', '.idea', '.vs', 'coverage', '.nyc_output'],
|
||||
_excludedFiles: ['.DS_Store', 'Thumbs.db', 'desktop.ini', '*.pyc', '*.pyo', '*.class', '*.o', '*.so', '*.dll'],
|
||||
_excludedFiles: ['.git', '.DS_Store', 'Thumbs.db', 'desktop.ini', '*.pyc', '*.pyo', '*.class', '*.o', '*.so', '*.dll'],
|
||||
|
||||
async load() {
|
||||
const container = document.getElementById('import-container');
|
||||
|
||||
@@ -1507,6 +1507,7 @@ router.post('/projects/upload', (req, res, next) => {
|
||||
for (let i = 0; i < files.length; i++) {
|
||||
const relativePath = paths[i].split('/').slice(1).join('/');
|
||||
if (!relativePath || relativePath.includes('..')) continue;
|
||||
if (relativePath === '.git' || relativePath.startsWith('.git/')) continue;
|
||||
const dest = join(tmpDir, relativePath);
|
||||
mkdirSync(dirname(dest), { recursive: true });
|
||||
writeFileSync(dest, files[i].buffer);
|
||||
|
||||
Reference in New Issue
Block a user