Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions dvc/command/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ def _check(self, conf, section, opt=None):
msg = "option {} doesn't exist"
raise ConfigError(msg.format(self.args.name))

if self.args.name == "core.no_scm" and self.args.level in [
"global",
"system",
]:
msg = "{} not allowed on a {} level"
raise ConfigError(msg.format(self.args.name, self.args.level))


parent_config_parser = argparse.ArgumentParser(add_help=False)
parent_config_parser.add_argument(
Expand Down
7 changes: 7 additions & 0 deletions tests/func/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,10 @@ def test_merging_two_levels(dvc):
def test_config_loads_without_error_for_non_dvc_repo(tmp_dir):
# regression testing for https://github.com/iterative/dvc/issues/3328
Config(validate=True)


def test_no_scm(dvc):
assert 251 == main(["config", "--global", "core.no_scm", "true"])
assert 251 == main(["config", "--system", "core.no_scm", "true"])
assert 0 == main(["config", "--local", "core.no_scm", "true"])
assert 0 == main(["config", "core.no_scm", "true"])