| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 64f0178 commit 3d7b374
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -224,9 +224,11 @@ def _run_hooks(config, hooks, args, environ): | |||
| 224 | 224 | '`pre-commit install`.', | |
| 225 | 225 | ) | |
| 226 | 226 | output.write_line('All changes made by hooks:') | |
| 227 | + # args.color is a boolean. | ||
| 228 | + # See user_color function in color.py | ||
| 227 | 229 | subprocess.call(( | |
| 228 | 230 | 'git', '--no-pager', 'diff', '--no-ext-diff', | |
| 229 | - '--color={}'.format(args.color), | ||
| 231 | + '--color={}'.format({True: 'always', False: 'never'}[args.color]), | ||
| 230 | 232 | )) | |
| 231 | 233 | ||
| 232 | 234 | return retval | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -184,15 +184,20 @@ def test_global_exclude(cap_out, store, tempdir_factory): | |||
| 184 | 184 | ( | |
| 185 | 185 | { | |
| 186 | 186 | 'show_diff_on_failure': True, | |
| 187 | - 'color': 'auto', | ||
| 187 | + }, | ||
| 188 | + b'All changes made by hooks:', | ||
| 189 | + ), | ||
| 190 | + ( | ||
| 191 | + { | ||
| 192 | + 'show_diff_on_failure': True, | ||
| 193 | + 'color': True, | ||
| 188 | 194 | }, | |
| 189 | 195 | b'All changes made by hooks:', | |
| 190 | 196 | ), | |
| 191 | 197 | ( | |
| 192 | 198 | { | |
| 193 | 199 | 'show_diff_on_failure': True, | |
| 194 | 200 | 'all_files': True, | |
| 195 | - 'color': 'auto', | ||
| 196 | 201 | }, | |
| 197 | 202 | b'reproduce locally with: pre-commit run --all-files', | |
| 198 | 203 | ), | |
| Back | FazBrowse Home | New Git URL |
0 commit comments