We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fbef2ff commit 13bf977Copy full SHA for 13bf977
src/gitingest/clone.py
@@ -7,14 +7,19 @@
7
8
async def check_repo_exists(url: str) -> bool:
9
proc = await asyncio.create_subprocess_exec(
10
- "git",
11
- "ls-remote",
+ "curl",
+ "-I",
12
url,
13
stdout=asyncio.subprocess.PIPE,
14
stderr=asyncio.subprocess.PIPE,
15
)
16
- await proc.communicate()
17
- return proc.returncode == 0
+ print("Checking if repo exists")
+ stdout, stderr = await proc.communicate()
18
+ if proc.returncode != 0:
19
+ return False
20
+ # Check if stdout contains "404" status code
21
+ stdout_str = stdout.decode()
22
+ return "HTTP/1.1 404" not in stdout_str and "HTTP/2 404" not in stdout_str
23
24
@async_timeout(CLONE_TIMEOUT)
25
async def clone_repo(query: dict) -> str:
0 commit comments