diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/dbnavigator.xml b/.idea/dbnavigator.xml new file mode 100644 index 0000000..038e418 --- /dev/null +++ b/.idea/dbnavigator.xml @@ -0,0 +1,427 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.idea/gitingest.iml b/.idea/gitingest.iml new file mode 100644 index 0000000..ebb4d42 --- /dev/null +++ b/.idea/gitingest.iml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..bb6faf8 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,12 @@ + + + + diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..cc5462d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..7f786ef --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..7195b92 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..5ace414 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/gitingest/utils/git_utils.py b/src/gitingest/utils/git_utils.py index 70b4cf4..1fd24e0 100644 --- a/src/gitingest/utils/git_utils.py +++ b/src/gitingest/utils/git_utils.py @@ -6,6 +6,7 @@ import asyncio import base64 import re from typing import Final +import sys from urllib.parse import urlparse import httpx @@ -74,10 +75,13 @@ async def run_command(*args: str) -> tuple[bytes, bytes]: async def ensure_git_installed() -> None: """Ensure Git is installed and accessible on the system. + On Windows, this also enables support for long file paths via + `git config --system core.longpaths true`. + Raises ------ RuntimeError - If Git is not installed or not accessible. + If Git is not installed or not accessible, or if enabling long paths fails. """ try: @@ -85,6 +89,12 @@ async def ensure_git_installed() -> None: except RuntimeError as exc: msg = "Git is not installed or not accessible. Please install Git first." raise RuntimeError(msg) from exc + if sys.platform == "win32": + try: + await run_command("git", "config", "--system", "core.longpaths", "true") + except RuntimeError as exc: + msg = "Failed to enable long paths. You may need to run the app as Administrator." + raise RuntimeError(msg) from exc async def check_repo_exists(url: str, token: str | None = None) -> bool: