Skip to content

Commit 293ab6a

Browse files
committed
handle renaming files properly
1 parent 1bb6756 commit 293ab6a

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

β€Žproperty-based-tests/regressionTests.test.tsβ€Ž

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,4 +172,13 @@ describe("regression tests", () => {
172172
},
173173
})
174174
})
175+
176+
describe("17", () => {
177+
executeTestCase({
178+
cleanFiles: {
179+
abc: { contents: "E\n", mode: 420 },
180+
},
181+
modifiedFiles: { cpz: { contents: "E\n", mode: 420 } },
182+
})
183+
})
175184
})

β€Žsrc/patch/parse.tsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ class PatchParser {
167167

168168
if (this.currentLine.startsWith("rename from")) {
169169
const fromPath = this.currentLine.slice("rename from ".length)
170-
const toPath = this.lines[this.i++].slice("rename to ".length).trim()
170+
const toPath = this.lines[++this.i].slice("rename to ".length).trim()
171171
this.result.push({ type: "rename", fromPath, toPath })
172172
continue
173173
}

0 commit comments

Comments
Β (0)