Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix
  • Loading branch information
filipchristiansen committed Jul 1, 2025
commit 2e9ca8a27bac089671e46b785083e1a683ad686d
2 changes: 1 addition & 1 deletion src/gitingest/query_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ async def try_domains_for_user_and_repo(user_name: str, repo_name: str, token: s
"""
for domain in KNOWN_GIT_HOSTS:
candidate = f"https://{domain}/{user_name}/{repo_name}"
if await check_repo_exists(candidate, token=token if domain == "github.com" else None):
if await check_repo_exists(candidate, token=token if domain.startswith("github.") else None):
return domain

msg = f"Could not find a valid repository host for '{user_name}/{repo_name}'."
Expand Down
2 changes: 1 addition & 1 deletion src/gitingest/utils/git_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ async def check_repo_exists(url: str, token: str | None = None) -> bool:
# Public GitHub vs. GitHub Enterprise
base_api = "https://api.github.com" if host == "github.com" else f"https://{host}/api/v3"
url = f"{base_api}/repos/{owner}/{repo}"
cmd += ["-H", "Accept: application/vnd.github+json", "-H", f"Authorization: Bearer {token}"]
cmd += [f"Authorization: Bearer {token}"]

cmd.append(url)

Expand Down
Loading