Skip to content
Snippets Groups Projects
Commit 95546cd1 authored by Neta Zmora's avatar Neta Zmora
Browse files

Fix for issue #60

The problem reported in issue #60 occurs when a user downloads an
archive of Distiller instead of performing "git clone".
When downloading an archive there is no ".git" directory and we
need to handle this gracefully.
For more details, see the issue itself.
parent b2f2ff67
No related branches found
No related tags found
No related merge requests found
......@@ -28,7 +28,7 @@ import logging
import logging.config
import numpy as np
import torch
from git import Repo
from git import Repo, InvalidGitRepositoryError
HAVE_LSB = True
try:
import lsb_release
......@@ -53,11 +53,15 @@ def log_execution_env_state(app_args, gitroot='.'):
It is useful to know what git tag we're using, and if we have outstanding code.
"""
repo = Repo(gitroot)
assert not repo.bare
try:
repo = Repo(gitroot)
assert not repo.bare
except InvalidGitRepositoryError:
logger.debug("Cannot find a Git repository. You probably downloaded an archive of Distiller.")
return
if repo.is_dirty():
logger.debug("Git is dirty")
logger.debug("Git is dirty")
try:
branch_name = repo.active_branch.name
except TypeError:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment