summaryrefslogtreecommitdiff
path: root/git-hooks
diff options
context:
space:
mode:
authorAndras Timar <atimar@novell.com>2011-04-14 10:21:53 +0200
committerAndras Timar <atimar@novell.com>2011-04-14 10:23:43 +0200
commit1c47c5cb1f5e2a6e3c7b231ef4e07e77c93ec0d9 (patch)
treed9640432389067df9dbe8b9e8f901cb70ed2fd6b /git-hooks
parent1da0fa202592350fe3836f4c6b8f8145c15fb166 (diff)
check if file exists in *.po hook
otherwise a removed file would be recreated
Diffstat (limited to 'git-hooks')
-rwxr-xr-xgit-hooks/pre-commit2
1 files changed, 1 insertions, 1 deletions
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 = <FILES>) {
open(FILES, "git diff-index --cached --name-only $against |") || die "Cannot run git diff-index.";
while (my $file = <FILES>) {
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");
}