Throw exception when clone repository name is blank

Prevents corrupting the shared drive by writing directly into the
root worktree or gitdir paths when the name cannot be derived.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-02-27 07:51:50 +01:00
parent 6e98901b9c
commit 2d74b000c4
2 changed files with 14 additions and 0 deletions
@@ -36,6 +36,8 @@ public class GitService
{
if (name == null || name.isBlank())
name = deriveRepositoryName(url);
if (name.isBlank())
throw new IllegalArgumentException("Repository name must not be blank");
Path worktree = properties.getWorktreePath().resolve(name);
Path gitDir = properties.getGitDirPath().resolve(name);