mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
stage add: don't fail if unable to create .gitignore
This commit is contained in:
committed by
David de la Iglesia Castro
parent
d57bb23c93
commit
b7732a591d
+9
-1
@@ -23,6 +23,7 @@ from dvc.exceptions import (
|
||||
OutputNotFoundError,
|
||||
)
|
||||
from dvc.repo import lock_repo
|
||||
from dvc.ui import ui
|
||||
from dvc.utils import as_posix, parse_target, relpath
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@@ -139,7 +140,14 @@ class StageLoad:
|
||||
)
|
||||
with self.repo.scm_context:
|
||||
stage.dump(update_lock=update_lock)
|
||||
stage.ignore_outs()
|
||||
try:
|
||||
stage.ignore_outs()
|
||||
except FileNotFoundError as exc:
|
||||
ui.warn(
|
||||
f"Could not create .gitignore entry in {exc.filename}."
|
||||
" DVC will attempt to create .gitignore entry again when"
|
||||
" the stage is run."
|
||||
)
|
||||
|
||||
return stage
|
||||
|
||||
|
||||
Reference in New Issue
Block a user