Last active
August 1, 2018 08:55
-
-
Save jason-neal/6f19e47a410b73b1a90f852b37c7600e to your computer and use it in GitHub Desktop.
Manually apply a pre-commit cached patch.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Manual call if pre-commit fails to restore unstaged work | |
git apply --whitespace=nowarn path\to\patch\patchXXXXXXXXX | |
# From https://github.com/pre-commit/pre-commit/blob/c3c6175c94ac043b0e6597238f712b615fbdb45f/pre_commit/staged_files_only.py | |
# def _git_apply(patch): | |
# args = ('apply', '--whitespace=nowarn', patch) | |
# try: | |
# cmd_output('git', *args, encoding=None) | |
# except CalledProcessError: | |
# # Retry with autocrlf=false -- see #570 | |
# cmd_output('git', '-c', 'core.autocrlf=false', *args, encoding=None) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment