From 1c47c5cb1f5e2a6e3c7b231ef4e07e77c93ec0d9 Mon Sep 17 00:00:00 2001 From: Andras Timar Date: Thu, 14 Apr 2011 10:21:53 +0200 Subject: check if file exists in *.po hook otherwise a removed file would be recreated --- git-hooks/pre-commit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'git-hooks') diff --git a/git-hooks/pre-commit b/git-hooks/pre-commit index abf1acb8d294..bf4eef13440b 100755 --- a/git-hooks/pre-commit +++ b/git-hooks/pre-commit @@ -154,7 +154,7 @@ while (my $file = ) { open(FILES, "git diff-index --cached --name-only $against |") || die "Cannot run git diff-index."; while (my $file = ) { chomp($file); - if ($file =~ /\.po$/) { + if ($file =~ /\.po$/ && -e $file) { system("msgcat --no-wrap $file > $file.KQnBbK6wQE;mv $file.KQnBbK6wQE $file;"); system("git add $file"); } -- cgit