statusMatrix() did not find modified files when working with package capacitor-fs
See original GitHub issueI am using Browser and Webpack 5, capacitor-fs
I cloned a repo and found the files that were changed but nothing came back
My code;
import FS from "capacitor-fs"
import git from "isomorphic-git"
import http from "isomorphic-git/http/web/index.js"
const fs = new FS({
rootDir: "/",
base64Alway: false
})
await git.clone({
fs,
http,
dir: "/fcanvas",
url: "https://github.com/shin-tachibana/fcanvas"
})
await fs.writeFile("/fcanvas/new file.txt", "hello new file.txt", "utf8")
await fs.writeFile("/fcanvas/README.md", "change content readme " + Math.random(), "utf8")
const matrix = await git.statusMatrix({
fs,
dir: "/fcanvas"
})
console.log(matrix)
/*
[
["new file.txt", 0, 2, 0]
]
expectations:
[
["new file.txt", 0, 2, 0],
["README.md", 2, 1, 2]
]
*/
My packages:
{
"dependencies": {
"@capacitor/core": "^3.1.2",
"@capacitor/filesystem": "^1.0.2",
"isomorphic-git": "^1.9.2",
"buffer": "^6.0.3",
"capacitor-fs": "^0.0.25",
"core-js": "^3.6.5",
"path-cross": "^0.0.3",
"quasar": "^2.0.0",
"vue-i18n": "^9.0.0-beta.0",
"vue-timeago.js": "0.0.2",
"vuex": "^4.0.1",
"vuex-persistedstate": "^4.0.0"
}
}
Issue Analytics
- State:
- Created 2 years ago
- Comments:14 (7 by maintainers)
Top Results From Across the Web
'git status' shows changed files, but 'git diff' doesn't
This is why I encounter the issue. Git keeps telling me my modification of line-ending has been changed and asks whether to commit...
Read more >statusMatrix - isomorphic-git
Efficiently get the status of multiple files at once. ... type StatusRow = Array<(string|number)>;. The returned StatusMatrix is admittedly not the easiest format ......
Read more >Get list of modified files between two commits #732 - GitHub
Given two commits x and y (identified by their hash), it is possible to list all files which have been modified in y...
Read more >Git commit modified file list display error
When git commit, in the list of modified files displayed, compare some files and find that there is no change to one line...
Read more >reliable way to find added/modified files by make install
One sample way to get the list of file operations done by make install is to execute: make -n install. This command will...
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 Free
Top 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
OK! Here, try copying https://github.com/isomorphic-git/statusMatrix/blob/main/statusMatrix.mjs into your project (upgrade to isomorphic-git version 1.10.0 for the
isIgnored
command) and then you can make whatever adjustments you need!Honestly,
statusMatrix
has rather confusing output, so it wouldn’t surprise me if most people prefer to start with that as a base and then modify it rather than use the version I wrote 🤷🏻.This is the perfect solution to my problem, thank you!