install: add pre-checkout hook

Fixes #1248

Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
Ruslan Kuprieiev
2018-10-22 01:18:55 +03:00
parent 94cf83c1cd
commit 437c2e7cbe
2 changed files with 12 additions and 4 deletions
+5 -1
View File
@@ -13,7 +13,11 @@ class TestInstall(TestDvc):
ret = main(['install'])
self.assertNotEqual(ret, 0)
self.assertTrue(os.path.isfile('.git/hooks/post-checkout'))
def hook(name):
return os.path.join('.git', 'hooks', name)
self.assertTrue(os.path.isfile(hook('post-checkout')))
self.assertTrue(os.path.isfile(hook('pre-commit')))
self.dvc.add(self.FOO)
os.unlink(self.FOO)