summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2019-04-23 13:59:30 -0400
committerDrew DeVault <sir@cmpwn.com>2019-04-23 13:59:30 -0400
commitad433b7b5cff54dc214e7ff73bc76c2f50c11d11 (patch)
treebba57551ce954875be55405f9ee6ccf21f4e09dc
parentf131db58b586fc38dab04f04f81168a165ce34ee (diff)
Handle new tags in gitsrht/submit.py
-rw-r--r--gitsrht/submit.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/gitsrht/submit.py b/gitsrht/submit.py
index 55ccd89..3b12452 100644
--- a/gitsrht/submit.py
+++ b/gitsrht/submit.py
@@ -117,11 +117,21 @@ def do_post_update(repo, refs):
old, new = update.decode().split(":")
old = git_repo.get(old)
new = git_repo.get(new)
- payload["refs"].append({
+ update = dict()
+ if isinstance(new, pygit2.Tag):
+ update.update({
+ "annotated_tag": {
+ "name": new.name,
+ "message": new.message,
+ },
+ })
+ new = git_repo.get(new.target)
+ update.update({
"name": ref,
"old": commit_to_dict(old) if old else None,
"new": commit_to_dict(new),
- })
+ }
+ payload["refs"].append(update)
try:
if re.match(r"^[0-9a-z]{40}$", ref): # commit