Also fetch tags.

This commit is contained in:
Patrick 2023-12-30 23:29:46 +01:00
parent 447a694eb0
commit fa1768381f

View File

@ -17,7 +17,7 @@ def cook(env: Environment, repo_name: str, remote_url: str, git_ref: str = "main
worktree_dir = os.path.join(env['CLONE_DIR'], 'git', repo_name, hashlib.shake_128(git_ref.encode('utf-8')).hexdigest(6)) # TODO: commit hash would be better, right? -> not if it's a branch! worktree_dir = os.path.join(env['CLONE_DIR'], 'git', repo_name, hashlib.shake_128(git_ref.encode('utf-8')).hexdigest(6)) # TODO: commit hash would be better, right? -> not if it's a branch!
if not os.path.exists(worktree_dir): if not os.path.exists(worktree_dir):
print(f'Checking out into {worktree_dir}.') print(f'Checking out into {worktree_dir}.')
origin.fetch() origin.fetch(tags=True)
os.makedirs(worktree_dir) os.makedirs(worktree_dir)
repo.git.worktree('add', worktree_dir, git_ref) repo.git.worktree('add', worktree_dir, git_ref)
elif env['UPDATE_REPOSITORIES']: elif env['UPDATE_REPOSITORIES']: