From 2d2ac67e50e4614d5a4d236b15171bd3b50648e6 Mon Sep 17 00:00:00 2001 From: Ruslan Kuprieiev Date: Mon, 9 Sep 2019 00:26:04 +0300 Subject: [PATCH] hooks: make syntax compatible with bare sh `==` is not part of the posix and not all shells (e.g. dash) support it, making hooks break. --- dvc/scm/git/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dvc/scm/git/__init__.py b/dvc/scm/git/__init__.py index bf30a2359..6afe2973b 100644 --- a/dvc/scm/git/__init__.py +++ b/dvc/scm/git/__init__.py @@ -241,7 +241,7 @@ class Git(Base): def _install_hook(self, name, cmd): command = ( - '[ "$3" == "0" ]' + '[ "$3" = "0" ]' ' || [ -z "$(git ls-files .dvc)" ]' " || exec dvc {}".format(cmd) )