Skip to content

Commit

Permalink
fix: force src and dst prefixes in diff to work around local diff.nop…
Browse files Browse the repository at this point in the history
…refix setting
  • Loading branch information
iiroj committed Mar 30, 2020
1 parent a653c55 commit 7f2ef33
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/gitWorkflow.js
Expand Up @@ -35,8 +35,16 @@ const STASH = 'lint-staged automatic backup'

const PATCH_UNSTAGED = 'lint-staged_unstaged.patch'

const GIT_DIFF_ARGS = [
'--binary', // support binary files
'--unified=0', // do not add lines around diff for consistent behaviour
'--no-color', // disable colors for consistent behaviour
'--no-ext-diff', // disable external diff tools for consistent behaviour
'--src-prefix=a/', // force prefix for consistent behaviour
'--dst-prefix=b/', // force prefix for consistent behaviour
'--patch' // output a patch that can be applied
]
const GIT_APPLY_ARGS = ['-v', '--whitespace=nowarn', '--recount', '--unidiff-zero']
const GIT_DIFF_ARGS = ['--binary', '--unified=0', '--no-color', '--no-ext-diff', '--patch']

const handleError = (error, ctx) => {
ctx.gitError = true
Expand Down

0 comments on commit 7f2ef33

Please sign in to comment.