fix: repo directory name collisions and custom directory support (#241)

* fix: repo directory name collisions and custom directory support

Allow users to specify a custom directory name when adding a remote repo, preventing collisions when cloning a fork of an already-cloned repo.

- Add shared validation and normalization utilities (shared/src/utils/repo.ts)
  for directory name sanitization, URL normalization, and path safety
- Replace duplicated sanitizeWorkspaceAliasSegment with shared helper
- Backend validates directoryName before use as filesystem path
- Frontend detects directory collisions with normalized URL comparison
- Move SSH credential setup after DB record creation

* add backend origin validation and base-directory collision detection

* fix potential ReDoS in repo url and directory name normalization
This commit is contained in:
Chris Scott authored and GitHub committed 2026-05-30 19:12:04 -04:00
1 parent 932d6b8d68
commit 60ed756a0b
7 files changed
+216 -29

No files matched your search

+1
View File
@@ -1 +1,2 @@
export * from './jsonc'
export * from './repo'