https://bugs.documentfoundation.org/show_bug.cgi?id=134286

            Bug ID: 134286
           Summary: pre-commit check for allownonascii is incorrect
           Product: LibreOffice
           Version: 7.0.0.0.beta1+
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: trivial
          Priority: medium
         Component: LibreOffice
          Assignee: [email protected]
          Reporter: [email protected]

In pre-commit git hook, non-ascii filenames are checked unless `git config
hooks.allownonascii` is "true".  However, the comparison $allownonascii ne
"true" is done without trailing newline, the hook always exists no matter what
the value of hooks.allownonascii is.

I don't intend to commit files with non-ascii filenames into the main repo, but
we needed it in our local fork.

Here's a suggested patch.


--- a/.git-hooks/pre-commit
+++ b/.git-hooks/pre-commit
@@ -280,6 +280,7 @@ if ( system( "git rev-parse --verify HEAD >/dev/null 2>&1"
) == 0 )

 # If you want to allow non-ascii filenames set this variable to true.
 my $allownonascii=`git config hooks.allownonascii`;
+chomp $allownonascii;

 # Cross platform projects tend to avoid non-ascii filenames; prevent
 # them from being added to the repository. We exploit the fact that the

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to