diff --git a/news/2597.bugfix.md b/news/2597.bugfix.md new file mode 100644 index 0000000000..66ab4dd1fb --- /dev/null +++ b/news/2597.bugfix.md @@ -0,0 +1 @@ +Failed to clone template repository if the URL contains the rev part. diff --git a/src/pdm/cli/templates/__init__.py b/src/pdm/cli/templates/__init__.py index 32874a5f8a..0ad13a460a 100644 --- a/src/pdm/cli/templates/__init__.py +++ b/src/pdm/cli/templates/__init__.py @@ -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()]