~edwargix/git.sr.ht

cd9e60363446e1255439b8fc59f09d87f9a6b283 — Peter Grayson 7 years ago da45d2e
Repair first_line to handle commit msg w/o newline

It is possible for commit messages to not have a newline character. Repair
the worker.first_line() function to accommodate such messages.
1 files changed, 6 insertions(+), 1 deletions(-)

M gitsrht/worker.py
M gitsrht/worker.py => gitsrht/worker.py +6 -1
@@ 34,7 34,12 @@ def do_webhook(url, payload, headers=None):
        return None

def first_line(text):
    return text[:text.index("\n") + 1]
    try:
        i = text.index("\n")
    except ValueError:
        return text + "\n"
    else:
        return text[:i + 1]

def submit_builds(repo, git_repo, commit):
    manifests = dict()