mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-16 02:21:46 +04:00
Fix git reference for tags to get actual latest tag
This commit is contained in:
parent
0fd4a2ea38
commit
42db8cde4f
1 changed files with 5 additions and 1 deletions
|
|
@ -41,7 +41,11 @@ def _update_repo(repo_config, store, tags_only):
|
|||
git.init_repo(repo_path, repo_config['repo'])
|
||||
cmd_output_b('git', 'fetch', 'origin', 'HEAD', '--tags', cwd=repo_path)
|
||||
|
||||
tag_cmd = ('git', 'describe', 'FETCH_HEAD', '--tags')
|
||||
# Get the latest tagged commit
|
||||
latest_tag_cmd = ('git', 'rev-list', '--tags', '--max-count=1')
|
||||
latest_tagged = cmd_output(*latest_tag_cmd, cwd=repo_path)[1].strip()
|
||||
|
||||
tag_cmd = ('git', 'describe', latest_tagged, '--tags')
|
||||
if tags_only:
|
||||
tag_cmd += ('--abbrev=0',)
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue