[Libreoffice-commits] .: Branch 'libreoffice-3-4' - git-hooks/pre-commit

Andras Timar timar at kemper.freedesktop.org
Thu Apr 14 01:24:28 PDT 2011


 git-hooks/pre-commit |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 59333dfb0f34fa45bbaee8d9f136cef5d0a92b39
Author: Andras Timar <atimar at novell.com>
Date:   Thu Apr 14 10:21:53 2011 +0200

    check if file exists in *.po hook
    
    otherwise a removed file would be recreated

diff --git a/git-hooks/pre-commit b/git-hooks/pre-commit
index abf1acb..bf4eef1 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");
     }


More information about the Libreoffice-commits mailing list