tests: install hook just before using it (#4472)
tests: install hook just before using it (#4472)

Before, we were installing hooks at the start which was making checkouts
slower. With this change, it should improve these tests by twice as much.
efiop/dvc,dmpetrov/dataversioncontrol,efiop/dvc,dmpetrov/dataversioncontrol