~edwargix/git.sr.ht

ad433b7b5cff54dc214e7ff73bc76c2f50c11d11 — Drew DeVault 6 years ago f131db5
Handle new tags in gitsrht/submit.py
1 files changed, 12 insertions(+), 2 deletions(-)

M gitsrht/submit.py
M gitsrht/submit.py => gitsrht/submit.py +12 -2
@@ 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