mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
dvc: more explict error during init when .dvc is ignored by git (#4978)
* dvc: more explict error during init when .dvc is ignored by git Fixes #3738 * dvc: address PR feedback * styling * styling
This commit is contained in:
@@ -111,3 +111,17 @@ def test_gen_dvcignore(tmp_dir):
|
||||
"# https://dvc.org/doc/user-guide/dvcignore\n"
|
||||
)
|
||||
assert text == (tmp_dir / ".dvcignore").read_text()
|
||||
|
||||
|
||||
def test_init_when_ignored_by_git(tmp_dir, scm, caplog):
|
||||
# https://github.com/iterative/dvc/issues/3738
|
||||
tmp_dir.gen({".gitignore": ".*"})
|
||||
with caplog.at_level(logging.ERROR, logger="dvc"):
|
||||
assert main(["init"]) == 1
|
||||
assert (
|
||||
"{dvc_dir} is ignored by your SCM tool. \n"
|
||||
"Make sure that it's tracked, "
|
||||
"for example, by adding '!.dvc' to .gitignore.".format(
|
||||
dvc_dir=tmp_dir / DvcRepo.DVC_DIR
|
||||
)
|
||||
) in caplog.text
|
||||
|
||||
Reference in New Issue
Block a user