Skip to content

Commit 99aaef0

Browse files
Fix Windows compatibility: subprocess support and long path handling
1 parent e023af3 commit 99aaef0

File tree

9 files changed

+506
-1
lines changed

9 files changed

+506
-1
lines changed

.idea/.gitignore

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/dbnavigator.xml

Lines changed: 427 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/gitingest.iml

Lines changed: 24 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/profiles_settings.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/gitingest/utils/git_utils.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import base64
77
import re
88
from typing import Final
9+
import sys
910
from urllib.parse import urlparse
1011

1112
import httpx
@@ -74,17 +75,26 @@ async def run_command(*args: str) -> tuple[bytes, bytes]:
7475
async def ensure_git_installed() -> None:
7576
"""Ensure Git is installed and accessible on the system.
7677
78+
On Windows, this also enables support for long file paths via
79+
`git config --system core.longpaths true`.
80+
7781
Raises
7882
------
7983
RuntimeError
80-
If Git is not installed or not accessible.
84+
If Git is not installed or not accessible, or if enabling long paths fails.
8185
8286
"""
8387
try:
8488
await run_command("git", "--version")
8589
except RuntimeError as exc:
8690
msg = "Git is not installed or not accessible. Please install Git first."
8791
raise RuntimeError(msg) from exc
92+
if sys.platform == "win32":
93+
try:
94+
await run_command("git", "config", "--system", "core.longpaths", "true")
95+
except RuntimeError as exc:
96+
msg = "Failed to enable long paths. You may need to run the app as Administrator."
97+
raise RuntimeError(msg) from exc
8898

8999

90100
async def check_repo_exists(url: str, token: str | None = None) -> bool:

0 commit comments

Comments
 (0)