Visitar URL original
feature: fetch tag pointing to HEAD in shallow clone by gnought · Pull Request #3617 · pre-commit/pre-commit · GitHub
Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
lint fix
  • Loading branch information
gnought committed Feb 18, 2026
commit 8fd50fcc98686f0726fa23836c7049509ed23297
5 changes: 4 additions & 1 deletion pre_commit/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,10 @@ def _shallow_clone(self, ref: str, git_cmd: Callable[..., None]) -> None:

git_config = 'protocol.version=2'
git_cmd('-c', git_config, 'fetch', 'origin', ref, '--depth=1')
git_cmd('-c', git_config, 'fetch', 'origin', f'refs/tags/{ref}:refs/tags/{ref}', '--depth=1', check=False)
git_cmd(
'-c', git_config, 'fetch', 'origin',
f'refs/tags/{ref}:refs/tags/{ref}', '--depth=1', check=False,
)
git_cmd('checkout', 'FETCH_HEAD')
git_cmd(
'-c', git_config, 'submodule', 'update', '--init', '--recursive',
Expand Down