File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed
Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change 2323 "bitbucket.org" ,
2424 "gitea.com" ,
2525 "codeberg.org" ,
26+ "gist.github.com" ,
2627 "gitingest.com" ,
2728]
2829
Original file line number Diff line number Diff line change @@ -55,6 +55,8 @@ async def ingest_async(
5555 TypeError
5656 If `clone_repo` does not return a coroutine, or if the `source` is of an unsupported type.
5757 """
58+ repo_cloned = False
59+
5860 try :
5961 parsed_query : ParsedQuery = await parse_query (
6062 source = source ,
@@ -75,16 +77,18 @@ async def ingest_async(
7577 commit = parsed_query .commit ,
7678 branch = selected_branch ,
7779 )
78- clone_result = clone_repo (clone_config )
80+ clone_coroutine = clone_repo (clone_config )
7981
80- if inspect .iscoroutine (clone_result ):
82+ if inspect .iscoroutine (clone_coroutine ):
8183 if asyncio .get_event_loop ().is_running ():
82- await clone_result
84+ await clone_coroutine
8385 else :
84- asyncio .run (clone_result )
86+ asyncio .run (clone_coroutine )
8587 else :
8688 raise TypeError ("clone_repo did not return a coroutine as expected." )
8789
90+ repo_cloned = True
91+
8892 summary , tree , content = run_ingest_query (parsed_query )
8993
9094 if output is not None :
@@ -94,8 +98,7 @@ async def ingest_async(
9498 return summary , tree , content
9599 finally :
96100 # Clean up the temporary directory if it was created
97- if parsed_query .url :
98- # Clean up the temporary directory
101+ if repo_cloned :
99102 shutil .rmtree (TMP_BASE_PATH )
100103
101104
You can’t perform that action at this time.
0 commit comments