mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
@@ -3,6 +3,7 @@
|
||||
import logging
|
||||
import os
|
||||
import yaml
|
||||
import shlex
|
||||
|
||||
from funcy import cached_property
|
||||
from pathspec.patterns import GitWildMatchPattern
|
||||
@@ -321,11 +322,13 @@ class Git(Base):
|
||||
if not self.files_to_track:
|
||||
return
|
||||
|
||||
files = " ".join(shlex.quote(path) for path in self.files_to_track)
|
||||
|
||||
logger.info(
|
||||
"\n"
|
||||
"To track the changes with git, run:\n"
|
||||
"\n"
|
||||
"\tgit add {files}".format(files=" ".join(self.files_to_track))
|
||||
"\tgit add {files}".format(files=files)
|
||||
)
|
||||
|
||||
def track_file(self, path):
|
||||
|
||||
@@ -37,3 +37,9 @@ class TestScmContext(TestCase):
|
||||
|
||||
self.assertEqual(0, self.scm_mock.reset_ignores.call_count)
|
||||
self.assertEqual(0, self.scm_mock.remind_to_track.call_count)
|
||||
|
||||
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user