diff --git a/dvc/commands/add.py b/dvc/commands/add.py index e128452e9..fd34cbe8b 100644 --- a/dvc/commands/add.py +++ b/dvc/commands/add.py @@ -16,7 +16,6 @@ class CmdAdd(CmdBase): self.repo.add( self.args.targets, no_commit=self.args.no_commit, - file=self.args.file, external=self.args.external, glob=self.args.glob, out=self.args.out, @@ -62,11 +61,6 @@ def add_parser(subparsers, parent_parser): default=False, help="Allows targets containing shell-style wildcards.", ) - parser.add_argument( - "--file", - help="Specify name of the .dvc file this command will generate.", - metavar="", - ) parser.add_argument( "-o", "--out", diff --git a/tests/func/test_add.py b/tests/func/test_add.py index d19e39bf3..f7328ad10 100644 --- a/tests/func/test_add.py +++ b/tests/func/test_add.py @@ -450,28 +450,6 @@ def test_add_force_overwrite_out(caplog, tmp_dir, dvc): assert (tmp_dir / "foo").read_text() == "foo" -def test_add_filename(tmp_dir, dvc): - tmp_dir.gen({"foo": "foo", "bar": "bar", "data": {"file": "file"}}) - ret = main(["add", "foo", "bar", "--file", "error.dvc"]) - assert ret != 0 - - ret = main(["add", "data", "--file", "data_directory.dvc"]) - assert ret == 0 - assert (tmp_dir / "data_directory.dvc").exists() - - ret = main(["add", "foo", "--file", "bar.dvc"]) - assert ret == 0 - assert (tmp_dir / "bar.dvc").exists() - assert not (tmp_dir / "foo.dvc").exists() - - (tmp_dir / "bar.dvc").unlink() - - ret = main(["add", "foo", "--file", "bar.dvc"]) - assert ret == 0 - assert (tmp_dir / "bar.dvc").exists() - assert not (tmp_dir / "foo.dvc").exists() - - def test_failed_add_cleanup(tmp_dir, scm, dvc): tmp_dir.gen({"foo": "foo", "bar": "bar"}) diff --git a/tests/unit/command/test_add.py b/tests/unit/command/test_add.py index 41c778b15..60ef72652 100644 --- a/tests/unit/command/test_add.py +++ b/tests/unit/command/test_add.py @@ -11,8 +11,6 @@ def test_add(mocker, dvc): "--no-commit", "--external", "--glob", - "--file", - "file", "data", ] ) @@ -27,7 +25,6 @@ def test_add(mocker, dvc): ["data"], no_commit=True, glob=True, - file="file", external=True, out=None, remote=None, @@ -60,7 +57,6 @@ def test_add_to_remote(mocker): ["s3://bucket/foo"], no_commit=False, glob=False, - file=None, external=False, out="bar", remote="remote",