Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/gitingest/query_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ async def parse_remote_repo(source: str, token: str | None = None) -> IngestionQ
A dictionary containing the parsed details of the repository.

"""
if not source.strip():
msg = "Invalid repository URL: cannot be empty or spaces only."
raise ValueError(msg)

parsed_url = await _normalise_source(source, token=token)
host = parsed_url.netloc
user, repo = _get_user_and_repo_from_path(parsed_url.path)
Expand Down
5 changes: 1 addition & 4 deletions src/server/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,7 @@ class IngestRequest(BaseModel):
@field_validator("input_text")
@classmethod
def validate_input_text(cls, v: str) -> str:
"""Validate that ``input_text`` is not empty."""
if not v.strip():
err = "input_text cannot be empty"
raise ValueError(err)
"""Validate ``input_text`` field."""
return removesuffix(v.strip(), ".git")

@field_validator("pattern")
Expand Down