mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-10 07:18:27 +01:00
if instead of try / catch
This commit is contained in:
+3
-5
@@ -21,11 +21,9 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def copy_git_file(repo, src, dst):
|
||||
try:
|
||||
# Assert that the file does indeed exist in git before attempting to
|
||||
# copy it.
|
||||
repo.scm.repo.head.commit.tree[src] # noqa
|
||||
except KeyError:
|
||||
# Assert that the file does indeed exist in git before attempting to
|
||||
# copy it.
|
||||
if src not in repo.scm.repo.head.commit.tree:
|
||||
raise FileOutsideRepoError(src)
|
||||
|
||||
src_full_path = os.path.join(repo.root_dir, src)
|
||||
|
||||
Reference in New Issue
Block a user