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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user