From 140faccb69aae480cfe1a7ff16fe76a4135d0587 Mon Sep 17 00:00:00 2001 From: drewcassidy Date: Sun, 25 Apr 2021 22:59:13 -0700 Subject: [PATCH] Attempt to fix tagging error? --- yaclog/cli/__main__.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/yaclog/cli/__main__.py b/yaclog/cli/__main__.py index 2878527..e9558a6 100644 --- a/yaclog/cli/__main__.py +++ b/yaclog/cli/__main__.py @@ -231,11 +231,13 @@ def release(obj: Changelog, v_flag, commit): abort=True) if tracked > 0: - repo.index.commit(f'Version {cur_version.name}\n\n{cur_version.body()}') + commit = repo.index.commit(f'Version {cur_version.name}\n\n{cur_version.body()}') print(f'Created commit {repo.head.commit.hexsha[0:7]}') + else: + commit = repo.head.commit - repo.create_tag(cur_version.name, message=cur_version.body(False)) - print(f'Created tag "{cur_version.name}".') + repo_tag = repo.create_tag(cur_version.name, ref=commit, message=cur_version.body(False)) + print(f'Created tag "{repo_tag.name}".') if __name__ == '__main__':