diff --git a/files/routes/jinja2.py b/files/routes/jinja2.py index de53b8a2d..101673dca 100644 --- a/files/routes/jinja2.py +++ b/files/routes/jinja2.py @@ -90,8 +90,11 @@ def git_head(): with open('.git/HEAD', encoding='utf_8') as head_f: head_txt = head_f.read() head_path = git_regex.match(head_txt).group(1) - with open('.git/' + head_path, encoding='utf_8') as ref_f: - gitref = ref_f.read()[:7] + try: + with open('.git/' + head_path, encoding='utf_8') as ref_f: + gitref = ref_f.read()[:7] + except: + gitref = 'Error' return (gitref, head_txt) @app.context_processor