• intrigeri's avatar
    lint_po: succeed if --cached was passed but no PO files were staged · af71169b
    intrigeri authored
    When having "lint_po --cached" in one's pre-commit hook, any attempt
    to create a commit that does not modify any PO file fails with:
    
      Traceback (most recent call last):
        File "/home/intrigeri/.home/prv-user/.combined/cyber/amnesia/live/git/submodules/jenkins-tools/slaves/lint_po", line 347, in <module>
          main(logging.getLogger())
        File "/home/intrigeri/.home/prv-user/.combined/cyber/amnesia/live/git/submodules/jenkins-tools/slaves/lint_po", line 327, in main
          chain = [(_check_po_file(next(iterator)),),
      StopIteration
    
      The po files you're trying to commit contain errors. Please fix them and try again.
    
    This is a regression introduced by c957b5b8,
    which b37a38ce fixed already, but only for the
    case when --cached is *not* passed.
    
    Note that in --cached mode, we don't display a warning: for details,
    see 0da94c64.
    af71169b