Do not require .git to be present
authorJohan Dahlin <johan@gnome.org>
Mon, 13 Sep 2010 13:33:06 +0000 (10:33 -0300)
committerJohan Dahlin <johan@gnome.org>
Mon, 13 Sep 2010 13:33:06 +0000 (10:33 -0300)
If .git is not present, do not require the pre-commit
hook to be present either

Makefile.am

index 9904c395ebb0a9aecc4e2525470f311d12dfbda8..78187eb7f9b1fc14e6cdc0fba40041c39370a115 100644 (file)
@@ -42,10 +42,10 @@ upload-release: $(distdir).tar.gz
        ssh gnome.org install-module $(distdir).tar.gz
 
 check-local:
-       @test -f .git/hooks/pre-commit || (echo -e "ERROR: missing \
-       pre-commit hook.\n\ncopy misc/pre-commit to .git/hooks"; false)
-       @test -x .git/hooks/pre-commit || (echo -e "ERROR: pre-commit \
-       is not executable\n\nrun chmod +x .git/hooks/pre-commit"; false)
+       @test ! -d $(top_srcdir)/.git || (test -f .git/hooks/pre-commit || (echo -e "ERROR: missing \
+       pre-commit hook.\n\ncopy misc/pre-commit to .git/hooks"; false))
+       @test ! -d $(top_srcdir)/.git || (test -x .git/hooks/pre-commit || (echo -e "ERROR: pre-commit \
+       is not executable\n\nrun chmod +x .git/hooks/pre-commit"; false))
        @echo "  PEP-8 INQUISITION"
        @find $(top_srcdir)/giscanner -name \*.py | sort | uniq | xargs $(PYTHON) $(top_srcdir)/misc/pep8.py --repeat --exclude=config.py
        @echo "  CHECK Pyflakes"