Skip to content

Commit 94dc07a

Browse files
committed
Use shallow clone to make the release
1 parent 8e3c4bd commit 94dc07a

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

tools/release/__init__.py

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -175,23 +175,18 @@ def isolated_temporary_checkout(
175175
git_checkout_dir = tmp_dir / f"pip-build-{target_ref}"
176176
nox_session.run(
177177
# fmt: off
178-
"git", "worktree", "add", "--force", "--checkout",
179-
str(git_checkout_dir), str(target_ref),
178+
"git", "clone",
179+
"--depth", "1",
180+
"--config", "core.autocrlf=false",
181+
"--branch", str(target_ref),
182+
"--",
183+
".", str(git_checkout_dir),
180184
# fmt: on
181185
external=True,
182186
silent=True,
183187
)
184188

185-
try:
186-
yield git_checkout_dir
187-
finally:
188-
nox_session.run(
189-
# fmt: off
190-
"git", "worktree", "remove", "--force", str(git_checkout_dir),
191-
# fmt: on
192-
external=True,
193-
silent=True,
194-
)
189+
yield git_checkout_dir
195190

196191

197192
def get_git_untracked_files() -> Iterator[str]:

0 commit comments

Comments
 (0)