Skip to content

Commit ceca235

Browse files
Merge pull request #916 from RonnyPfannschmidt/fix-913-larger-timeout-for-unshallow
Fix 913 larger timeout for unshallow
2 parents 6beec52 + 9d83cb3 commit ceca235

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

CHANGELOG.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ bugfix
55
------
66

77
* fix #912: ensure mypy safety of the version template + regression test
8-
8+
* fix #913: use 240s timeout instead of 20 for git unshallow
9+
to account for large repos or slow connections
910

1011
v8.0.1
1112
======

src/setuptools_scm/git.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,18 @@
4848

4949

5050
def run_git(
51-
args: Sequence[str | os.PathLike[str]], repo: Path, *, check: bool = False
51+
args: Sequence[str | os.PathLike[str]],
52+
repo: Path,
53+
*,
54+
check: bool = False,
55+
timeout: int = 20,
5256
) -> _CompletedProcess:
53-
return _run(["git", "--git-dir", repo / ".git", *args], cwd=repo, check=check)
57+
return _run(
58+
["git", "--git-dir", repo / ".git", *args],
59+
cwd=repo,
60+
check=check,
61+
timeout=timeout,
62+
)
5463

5564

5665
class GitWorkdir(Workdir):
@@ -127,7 +136,7 @@ def is_shallow(self) -> bool:
127136
return self.path.joinpath(".git/shallow").is_file()
128137

129138
def fetch_shallow(self) -> None:
130-
run_git(["fetch", "--unshallow"], self.path, check=True)
139+
run_git(["fetch", "--unshallow"], self.path, check=True, timeout=240)
131140

132141
def node(self) -> str | None:
133142
def _unsafe_short_node(node: str) -> str:

0 commit comments

Comments
 (0)