git.add adds wrong filepath when filepath is multibyte string (like Japanese)
See original GitHub issueI encountered on Node@10, Chrome 68 and isomorphic-git@0.24.2
const root = '/my-root'
const addingFilepath = "日本語"
await fs.promises.writeFile(path.join(root, addingFilepath), "1")
await git.add({ fs, dir: root, filepath: addingFilepath })
await git.commit({
fs,
dir: root,
message: "Add japanese file",
author: { email: "dummy", name: "dummy" }
})
const files = await git.listFiles({ fs, dir: root })
console.log(files)
This result lost some data
[ '日' ] // expected: ['日本語']
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
How to handle Asian characters in file names in Git on OS X
In my limited testing (using Git 1.7.3.2 on Ubuntu), once I disabled core.quotepath , git would display the filenames as expected. Also, even...
Read more >Problem for creating RTF file for Japanese Language (Origin ...
When I see the 'wrong' RTF file, I find a '}' character in the title string. I think it may cause this problem....
Read more >gitattributes Documentation - Git
gitattributes file in the same directory as the path in question, and its parent directories up to the toplevel of the work tree...
Read more >Diff - pub/scm/git/git - Git repositories on kernel
Merge branch 'nd/shallow-deepen' The existing "git fetch --depth=<n>" option was hard to use correctly when making the history of an existing shallow clone ......
Read more >How to resolve UTF-8 Encoding issue in Jenkins - LinkedIn
To resolve the encoding issue we have to add the environment variable in system as shown below first. These environment variables were added ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@wmhilton
Thank you! It works in this case!
but … sorry, now I found another case under directory.
Ah yes. It’s not because it was under a directory per se, but due to the length of the filename. Thank you for the fix!