Skip to content

Commit 61da031

Browse files
Adding fallback logic if git command fails'
1 parent 234e1ac commit 61da031

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/gitingest/query_parser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,15 +190,15 @@ async def _configure_branch_and_subpath(remaining_parts: list[str],url: str) ->
190190
191191
Returns
192192
-------
193-
str(branch name) or None
193+
str (branch name) or None
194194
195195
"""
196196
try:
197197
# Fetch the list of branches from the remote repository
198198
branches: list[str] = await fetch_remote_branch_list(url)
199199
except Exception as e:
200200
print(f"Warning: Failed to fetch branch list: {str(e)}")
201-
return remaining_parts.pop(0)
201+
return remaining_parts.pop(0) if remaining_parts else None
202202

203203
branch = []
204204

0 commit comments

Comments
 (0)