Kaydet (Commit) 46ab76a7 authored tarafından Miklos Vajna's avatar Miklos Vajna

git-hooks: fix pre-commit in submodules

translations.git failed with "Can't locate ClangFormat.pm in @INC (you
may need to install the ClangFormat module)".

Change-Id: Ibbe051c1cb4c1200da58821589b8271434b1f9a6
Reviewed-on: https://gerrit.libreoffice.org/45020Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
Tested-by: 's avatarJenkins <ci@libreoffice.org>
üst 95e3e5b8
......@@ -7,7 +7,6 @@
use strict;
use lib "solenv/clang-format";
use ClangFormat;
#use File::Copy;
#use Cwd;
......@@ -112,6 +111,15 @@ sub check_whitespaces($)
sub check_style($)
{
if (! -e "solenv/clang-format/ClangFormat.pm")
{
# Commit happens in a submodule.
return;
}
require ClangFormat;
ClangFormat->import();
my ($h) = @_;
my $src = ClangFormat::get_extension_regex();
my @bad_names = ();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment