mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-17 15:28:28 +01:00
This reverts commit ce2d7c65db.
This commit is contained in:
+2
-11
@@ -272,19 +272,10 @@ class Git(Base):
|
||||
self.files_to_track = set()
|
||||
|
||||
def remind_to_track(self):
|
||||
def _filter(files):
|
||||
if not files:
|
||||
return set()
|
||||
staged, unstaged, untracked = self.status()
|
||||
return files.intersection(
|
||||
staged.get("modify", []) + unstaged + untracked
|
||||
)
|
||||
|
||||
files_to_track = _filter(self.files_to_track)
|
||||
if self.quiet or not files_to_track:
|
||||
if self.quiet or not self.files_to_track:
|
||||
return
|
||||
|
||||
files = " ".join(shlex.quote(path) for path in sorted(files_to_track))
|
||||
files = " ".join(shlex.quote(path) for path in self.files_to_track)
|
||||
|
||||
logger.info(
|
||||
"\n"
|
||||
|
||||
@@ -528,20 +528,10 @@ def test_reset(tmp_dir, scm, git):
|
||||
assert len(unstaged) == 2
|
||||
|
||||
|
||||
def test_remind_to_track(tmp_dir, scm, caplog):
|
||||
files = ["fname with spaces.txt", "тест", "foo"]
|
||||
tmp_dir.gen({name: "foo" for name in files})
|
||||
scm.files_to_track.update(files)
|
||||
|
||||
def test_remind_to_track(scm, caplog):
|
||||
scm.files_to_track = ["fname with spaces.txt", "тест", "foo"]
|
||||
scm.remind_to_track()
|
||||
assert "git add 'fname with spaces.txt' foo 'тест'" in caplog.text
|
||||
|
||||
scm.add(["foo"])
|
||||
caplog.clear()
|
||||
|
||||
scm.remind_to_track()
|
||||
assert "git add 'fname with spaces.txt' 'тест'" in caplog.text
|
||||
assert "foo" not in caplog.text
|
||||
assert "git add 'fname with spaces.txt' 'тест' foo" in caplog.text
|
||||
|
||||
|
||||
def test_add(tmp_dir, scm, git):
|
||||
|
||||
Reference in New Issue
Block a user