Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .yarn/versions/c2f45bf8.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
releases:
"@yarnpkg/plugin-patch": patch

declined:
- "@yarnpkg/plugin-compat"
- "@yarnpkg/cli"
2 changes: 1 addition & 1 deletion packages/plugin-patch/sources/patchUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ export async function diffFolders(folderA: PortablePath, folderB: PortablePath)
const folderAN = npath.fromPortablePath(folderA).replace(/\\/g, `/`);
const folderBN = npath.fromPortablePath(folderB).replace(/\\/g, `/`);

const {stdout, stderr} = await execUtils.execvp(`git`, [`-c`, `core.safecrlf=false`, `diff`, `--src-prefix=a/`, `--dst-prefix=b/`, `--ignore-cr-at-eol`, `--full-index`, `--no-index`, `--no-renames`, `--text`, folderAN, folderBN], {
const {stdout, stderr} = await execUtils.execvp(`git`, [`-c`, `core.safecrlf=false`, `-c`, `core.quotePath=false`, `diff`, `--src-prefix=a/`, `--dst-prefix=b/`, `--ignore-cr-at-eol`, `--full-index`, `--no-index`, `--no-renames`, `--text`, folderAN, folderBN], {
cwd: npath.toPortablePath(process.cwd()),
env: {
...process.env,
Expand Down
44 changes: 44 additions & 0 deletions packages/plugin-patch/tests/__snapshots__/diffFolders.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -219,3 +219,47 @@ exports[`diffFolders Makes and parses diff for 'update' 2`] = `
},
]
`;

exports[`diffFolders Makes and parses diff for '测试' 1`] = `
"diff --git a/foo.txt b/foo.txt
new file mode 100644
index 0000000000000000000000000000000000000000..257cc5642cb1a054f08cc83f2d943e56fd3ebe99
--- /dev/null
+++ b/foo.txt
@@ -0,0 +1 @@
+foo
"
`;

exports[`diffFolders Makes and parses diff for '测试' 2`] = `
[
{
"hash": "257cc5642cb1a054f08cc83f2d943e56fd3ebe99",
"hunk": {
"header": {
"original": {
"length": 0,
"start": 1,
},
"patched": {
"length": 1,
"start": 1,
},
},
"parts": [
{
"lines": [
"foo",
],
"noNewlineAtEndOfFile": false,
"type": "insertion",
},
],
},
"mode": 420,
"path": "foo.txt",
"semverExclusivity": null,
"type": "file creation",
},
]
`;
Empty file.
Empty file.
1 change: 1 addition & 0 deletions packages/plugin-patch/tests/fixtures/测试/b/foo.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
foo
Loading