(cap_out, store, repo_with_passing_hook)
| 777 | |
| 778 | |
| 779 | def test_no_textconv(cap_out, store, repo_with_passing_hook): |
| 780 | # git textconv filters can hide changes from hooks |
| 781 | with open('.gitattributes', 'w') as fp: |
| 782 | fp.write('*.jpeg diff=empty\n') |
| 783 | |
| 784 | with open('.git/config', 'a') as fp: |
| 785 | fp.write('[diff "empty"]\n') |
| 786 | fp.write('textconv = "true"\n') |
| 787 | |
| 788 | config = { |
| 789 | 'repo': 'local', |
| 790 | 'hooks': [ |
| 791 | { |
| 792 | 'id': 'extend-jpeg', |
| 793 | 'name': 'extend-jpeg', |
| 794 | 'language': 'system', |
| 795 | 'entry': ( |
| 796 | f'{shlex.quote(sys.executable)} -c "import sys; ' |
| 797 | 'open(sys.argv[1], \'ab\').write(b\'\\x00\')"' |
| 798 | ), |
| 799 | 'types': ['jpeg'], |
| 800 | }, |
| 801 | ], |
| 802 | } |
| 803 | add_config_to_repo(repo_with_passing_hook, config) |
| 804 | |
| 805 | stage_a_file('example.jpeg') |
| 806 | |
| 807 | _test_run( |
| 808 | cap_out, |
| 809 | store, |
| 810 | repo_with_passing_hook, |
| 811 | {}, |
| 812 | ( |
| 813 | b'Failed', |
| 814 | ), |
| 815 | expected_ret=1, |
| 816 | stage=False, |
| 817 | ) |
| 818 | |
| 819 | |
| 820 | def test_stages(cap_out, store, repo_with_passing_hook): |
nothing calls this directly
no test coverage detected