mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
init: add *.local_state to gitignore
Fixes #313 Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
+3
-1
@@ -5,6 +5,7 @@ from dvc.command.common.base import CmdBase
|
||||
from dvc.logger import Logger
|
||||
from dvc.config import Config
|
||||
from dvc.exceptions import DvcException
|
||||
from dvc.path.data_item import DataItem
|
||||
|
||||
|
||||
class InitError(DvcException):
|
||||
@@ -107,7 +108,8 @@ ProjectName =
|
||||
conf_file.close()
|
||||
|
||||
self.git.modify_gitignore([os.path.join(config_dir_path.name, cache_dir_path.name),
|
||||
os.path.join(config_dir_path.name, os.path.basename(self.git.lock_file))])
|
||||
os.path.join(config_dir_path.name, os.path.basename(self.git.lock_file)),
|
||||
os.path.join(config_dir_path.name, state_dir_path.name, '*' + DataItem.LOCAL_STATE_FILE_SUFFIX)])
|
||||
|
||||
message = 'DVC init. cache dir {}, state dir {}, '.format(cache_dir_path.name, state_dir_path.name)
|
||||
return self.commit_if_needed(message)
|
||||
|
||||
@@ -125,4 +125,3 @@ class DataItem(object):
|
||||
cache_state = CacheStateFile(self).save()
|
||||
|
||||
local_state = LocalStateFile(self).save()
|
||||
self._git.modify_gitignore([self.local_state.relative])
|
||||
|
||||
Reference in New Issue
Block a user