Skip to content

Commit

Permalink
fix: Failed to clone template repository if the URL contains the rev …
Browse files Browse the repository at this point in the history
…part

Close pdm-project#2597

Signed-off-by: Frost Ming <[email protected]>
  • Loading branch information
frostming committed Feb 1, 2024
1 parent d8a3375 commit bdb51de
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions news/2597.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Failed to clone template repository if the URL contains the rev part.
1 change: 1 addition & 0 deletions src/pdm/cli/templates/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ def _prepare_git_template(self, url: str) -> None:
left, amp, right = url.rpartition("@")
if left != "git" and amp:
extra_args = [f"--branch={right}"]
url = left
else:
extra_args = []
git_command = ["git", "clone", "--recursive", "--depth=1", *extra_args, url, self._path.as_posix()]
Expand Down

0 comments on commit bdb51de

Please sign in to comment.