Skip to content

Commit 774da4c

Browse files
fix
1 parent 6ef39d9 commit 774da4c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/gitingest/utils/git_utils.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ async def check_repo_exists(url: str, token: str | None = None) -> bool:
102102
If the curl command returns an unexpected status code.
103103
104104
"""
105-
expected_path_length = 2
106105
if token and is_github_host(url):
107106
return await _check_github_repo_exists(url, token=token)
108107

@@ -121,11 +120,13 @@ async def check_repo_exists(url: str, token: str | None = None) -> bool:
121120
response = stdout.decode()
122121
status_line = response.splitlines()[0].strip()
123122
parts = status_line.split(" ")
123+
124+
expected_path_length = 2
124125
if len(parts) >= expected_path_length:
125-
status_code_str = parts[1]
126-
if status_code_str in ("200", "301"):
126+
status = parts[1]
127+
if status in ("200", "301"):
127128
return True
128-
if status_code_str in ("302", "404"):
129+
if status in ("302", "404"):
129130
return False
130131
msg = f"Unexpected status line: {status_line}"
131132
raise RuntimeError(msg)

0 commit comments

Comments
 (0)