diff --git a/dvc/scm.py b/dvc/scm.py index 4a5082316..55321665a 100644 --- a/dvc/scm.py +++ b/dvc/scm.py @@ -59,7 +59,7 @@ class Git(Base): if not gitignore.startswith(self.root_dir): raise FileNotInRepoError() - if os.path.exists(gitignore) and entry in open(gitignore, 'r').read(): + if os.path.exists(gitignore) and entry in open(gitignore, 'r').readline(): return open(gitignore, 'a').write('\n' + entry)