fix: preserve unicode in filepaths when commit signing (#3588)
This commit is contained in:
parent
41aa45058f
commit
b17f5105d8
@ -19,15 +19,15 @@ git clone git://127.0.0.1/repos/test-base.git /git/local/repos/test-base
|
|||||||
cd /git/local/repos/test-base
|
cd /git/local/repos/test-base
|
||||||
git config --global user.email "you@example.com"
|
git config --global user.email "you@example.com"
|
||||||
git config --global user.name "Your Name"
|
git config --global user.name "Your Name"
|
||||||
echo "#test-base" > README_TEMP.md
|
echo "#test-base" > README→TEMP.md
|
||||||
git add .
|
git add .
|
||||||
git commit -m "initial commit"
|
git commit -m "initial commit"
|
||||||
git commit --allow-empty -m "empty commit for tests"
|
git commit --allow-empty -m "empty commit for tests"
|
||||||
echo "#test-base :sparkles:" > README_TEMP.md
|
echo "#test-base :sparkles:" > README→TEMP.md
|
||||||
git add .
|
git add .
|
||||||
git commit -m "add sparkles" -m "Change description:
|
git commit -m "add sparkles" -m "Change description:
|
||||||
- updates README_TEMP.md to add sparkles to the title"
|
- updates README→TEMP.md to add sparkles to the title"
|
||||||
mv README_TEMP.md README.md
|
mv README→TEMP.md README.md
|
||||||
git add .
|
git add .
|
||||||
git commit -m "rename readme"
|
git commit -m "rename readme"
|
||||||
git push -u
|
git push -u
|
||||||
|
@ -20,7 +20,7 @@ describe('git-command-manager integration tests', () => {
|
|||||||
expect(initialCommit.signed).toBeFalsy()
|
expect(initialCommit.signed).toBeFalsy()
|
||||||
expect(initialCommit.changes[0].mode).toEqual('100644')
|
expect(initialCommit.changes[0].mode).toEqual('100644')
|
||||||
expect(initialCommit.changes[0].status).toEqual('A')
|
expect(initialCommit.changes[0].status).toEqual('A')
|
||||||
expect(initialCommit.changes[0].path).toEqual('README_TEMP.md')
|
expect(initialCommit.changes[0].path).toEqual('README→TEMP.md') // filename contains unicode
|
||||||
|
|
||||||
expect(emptyCommit.subject).toEqual('empty commit for tests')
|
expect(emptyCommit.subject).toEqual('empty commit for tests')
|
||||||
expect(emptyCommit.tree).toEqual(initialCommit.tree) // empty commits have no tree and reference the parent's
|
expect(emptyCommit.tree).toEqual(initialCommit.tree) // empty commits have no tree and reference the parent's
|
||||||
@ -33,7 +33,7 @@ describe('git-command-manager integration tests', () => {
|
|||||||
expect(modifiedCommit.signed).toBeFalsy()
|
expect(modifiedCommit.signed).toBeFalsy()
|
||||||
expect(modifiedCommit.changes[0].mode).toEqual('100644')
|
expect(modifiedCommit.changes[0].mode).toEqual('100644')
|
||||||
expect(modifiedCommit.changes[0].status).toEqual('M')
|
expect(modifiedCommit.changes[0].status).toEqual('M')
|
||||||
expect(modifiedCommit.changes[0].path).toEqual('README_TEMP.md')
|
expect(modifiedCommit.changes[0].path).toEqual('README→TEMP.md')
|
||||||
|
|
||||||
expect(headCommit.subject).toEqual('rename readme')
|
expect(headCommit.subject).toEqual('rename readme')
|
||||||
expect(headCommit.parents[0]).toEqual(modifiedCommit.sha)
|
expect(headCommit.parents[0]).toEqual(modifiedCommit.sha)
|
||||||
@ -43,6 +43,6 @@ describe('git-command-manager integration tests', () => {
|
|||||||
expect(headCommit.changes[0].path).toEqual('README.md')
|
expect(headCommit.changes[0].path).toEqual('README.md')
|
||||||
expect(headCommit.changes[1].mode).toEqual('100644')
|
expect(headCommit.changes[1].mode).toEqual('100644')
|
||||||
expect(headCommit.changes[1].status).toEqual('D')
|
expect(headCommit.changes[1].status).toEqual('D')
|
||||||
expect(headCommit.changes[1].path).toEqual('README_TEMP.md')
|
expect(headCommit.changes[1].path).toEqual('README→TEMP.md')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
2
dist/index.js
vendored
2
dist/index.js
vendored
@ -774,6 +774,8 @@ class GitCommandManager {
|
|||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
const endOfBody = '###EOB###';
|
const endOfBody = '###EOB###';
|
||||||
const output = yield this.exec([
|
const output = yield this.exec([
|
||||||
|
'-c',
|
||||||
|
'core.quotePath=false',
|
||||||
'show',
|
'show',
|
||||||
'--raw',
|
'--raw',
|
||||||
'--cc',
|
'--cc',
|
||||||
|
@ -157,6 +157,8 @@ export class GitCommandManager {
|
|||||||
async getCommit(ref: string): Promise<Commit> {
|
async getCommit(ref: string): Promise<Commit> {
|
||||||
const endOfBody = '###EOB###'
|
const endOfBody = '###EOB###'
|
||||||
const output = await this.exec([
|
const output = await this.exec([
|
||||||
|
'-c',
|
||||||
|
'core.quotePath=false',
|
||||||
'show',
|
'show',
|
||||||
'--raw',
|
'--raw',
|
||||||
'--cc',
|
'--cc',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user