0

I have generated the patch with the below git command

git diff -b -w lib/web/mage/requirejs/mixins.js > mixinjs.patch

When I applied the patch I got the below error

$ git apply --check --reverse --verbose mixinjs.patch
Checking patch lib/web/mage/requirejs/mixins.js...
error: while searching for:
], function (module) {
    'use strict';

    var contexts = require.s.contexts,
        defContextName = '_',
        defContext = contexts[defContextName],
        unbundledContext = require.s.newContext('$'),
        defaultConfig = defContext.config,
        unbundledConfig = {
            baseUrl: defaultConfig.baseUrl,
            paths: defaultConfig.paths,
            shim: defaultConfig.shim,
            config: defaultConfig.config,
            map: defaultConfig.map
        },
        rjsMixins;

    /**
     * Prepare a separate context where modules are not assigned to bundles
     * so we are able to get their true path and corresponding mixins.
     */
    unbundledContext.configure(unbundledConfig);

    /**
     * Checks if specified string contains

error: patch failed: lib/web/mage/requirejs/mixins.js:7
error: lib/web/mage/requirejs/mixins.js: patch does not apply

I can apply the patch successfully If I use the below git apply command

git apply --ignore-space-change --ignore-whitespace m2-hotfixes/magepack_mixinjs.patch

But the problem is we can't change the git apply command to above one, we are using the Magento cloud PaaS environment which does not allow to change git apply command.

In git diff, I mentioned ignore space(-b) and ignore whitespace(-w), but it is not working. When we mentioned ignore space and ignore white space in git apply command, that is the time only it works.

Please help me to solve this issue.

Thanks in advance.

Bilal Usean
  • 2,322
  • 3
  • 22
  • 45

0 Answers0