diff options
author | Tzu-ping Chung <uranusjr@gmail.com> | 2021-07-25 13:18:31 +0800 |
---|---|---|
committer | Tzu-ping Chung <uranusjr@gmail.com> | 2021-07-25 13:18:31 +0800 |
commit | 94dc07a28a5d3e32c5ade3e27bb6916fc65a7a35 (patch) | |
tree | cdaf5d05f0dea631d8354538c9ea359b554ac575 /tools | |
parent | 8e3c4bd3b9660636aaa7ab6d0ad844654cb623c4 (diff) | |
download | pip-94dc07a28a5d3e32c5ade3e27bb6916fc65a7a35.tar.gz |
Use shallow clone to make the release
Diffstat (limited to 'tools')
-rw-r--r-- | tools/release/__init__.py | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/tools/release/__init__.py b/tools/release/__init__.py index cc60f442f..06a9767d5 100644 --- a/tools/release/__init__.py +++ b/tools/release/__init__.py @@ -175,23 +175,18 @@ def isolated_temporary_checkout( git_checkout_dir = tmp_dir / f"pip-build-{target_ref}" nox_session.run( # fmt: off - "git", "worktree", "add", "--force", "--checkout", - str(git_checkout_dir), str(target_ref), + "git", "clone", + "--depth", "1", + "--config", "core.autocrlf=false", + "--branch", str(target_ref), + "--", + ".", str(git_checkout_dir), # fmt: on external=True, silent=True, ) - try: - yield git_checkout_dir - finally: - nox_session.run( - # fmt: off - "git", "worktree", "remove", "--force", str(git_checkout_dir), - # fmt: on - external=True, - silent=True, - ) + yield git_checkout_dir def get_git_untracked_files() -> Iterator[str]: |