diff --git a/checkout.py b/checkout.py index 5dbb375ca..8d5cccecd 100644 --- a/checkout.py +++ b/checkout.py @@ -676,7 +676,7 @@ class GitCheckout(CheckoutBase): else: # No need to do anything special with p.is_new or if not # p.diff_hunks. git apply manages all that already. - cmd = ['apply', '--index', '-p%s' % p.patchlevel] + cmd = ['apply', '--index', '-3', '-p%s' % p.patchlevel] if verbose: cmd.append('--verbose') stdout.append(self._check_output_git(cmd, stdin=p.get(True))) diff --git a/tests/checkout_test.py b/tests/checkout_test.py index d07f15ac7..e18db0a7c 100755 --- a/tests/checkout_test.py +++ b/tests/checkout_test.py @@ -457,8 +457,8 @@ class GitCheckout(GitBaseTest): def testException(self): self._check_exception( self._get_co(None), - 'While running git apply --index -p1;\n fatal: corrupt patch at line ' - '12\n') + 'While running git apply --index -3 -p1;\n fatal: corrupt patch at ' + 'line 12\n') def testProcess(self): self._test_process(self._get_co)