~edwargix/git.sr.ht

75f35929cb98752b3cdd1529e04d1e2fd4cfbde1 — Eli Schwartz 2 years ago 38c6cda
archive .asc endpoint: handle junk data
1 files changed, 4 insertions(+), 1 deletions(-)

M gitsrht/blueprints/repo.py
M gitsrht/blueprints/repo.py => gitsrht/blueprints/repo.py +4 -1
@@ 193,7 193,10 @@ def lookup_ref(git_repo, ref, path):
    return commit, ref, "/".join(path)

def lookup_signature(git_repo, ref, fmt=['tar', 'tar.gz']):
    commit_or_tag = git_repo.revparse_single(ref)
    try:
        commit_or_tag = git_repo.revparse_single(ref)
    except (KeyError, ValueError):
        return None, None
    if not isinstance(commit_or_tag, (pygit2.Commit, pygit2.Tag)):
        return None, None