populateStat is not a function
See original GitHub issuePlease be sure to mention:
- On Nodejs electron app
- Using via NPM package
I’ve tried the snippet posted on this issue - https://github.com/isomorphic-git/isomorphic-git/issues/732
Assuming it’s a bit older the only change i could notice was that the snipped used walkBeta1
but the new version (1.21.0) only has walk
.
When I tried logging A,B I get this error
My code version -
export const getChangedFiles = async (localGitFolderPath) => {
try {
const commits = await log({ fs, dir:localGitFolderPath, depth: 2 })
const oids = commits.map(commit => commit.oid)
console.log(oids)
const A = await TREE({ fs, dir: localGitFolderPath, oid: oids[0] })
const B = await TREE({ fs, dir: localGitFolderPath, oid: oids[oids.length - 1] })
console.log(A,B)
return walk({
fs,
dir:localGitFolderPath,
trees: [
A,B
],
map: async function ([A, B]) {
// ignore directories
if (A.fullpath === '.') {
return
}
await A.populateStat()
if (A.type === 'tree') {
return
}
await B.populateStat()
if (B.type === 'tree') {
return
}
// generate ids
await A.populateHash()
await B.populateHash()
// determine modification type
let type = 'equal'
if (A.oid !== B.oid) {
type = 'modify'
}
if (A.oid === undefined) {
type = 'add'
}
if (B.oid === undefined) {
type = 'remove'
}
if (A.oid === undefined && B.oid === undefined) {
console.log('Something weird happened:')
console.log(A)
console.log(B)
}
return {
path: `/${A.fullpath}`,
type: type
}
}
})
} catch (err) {
console.log(err)
}
}
Issue Analytics
- State:
- Created 10 months ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
TypeError: booking.populate(...).populate is not a function
execPopulate is not a function. I don't know what happened but this is my code: BookingController.js const Booking = require('.
Read more >Get list of modified files between two commits #732 - GitHub
I took a look at walkBeta1 and statusMatrix but they do both not seem to be able to satisfy my ... populateStat is...
Read more >$.plot is not a function - Google Groups
I get the above error message when trying to draw a graph. This message however does not appear all the time which is...
Read more >1524377 – LMDB.xs need 64-bit arch - Red Hat Bugzilla
LMDB.xs: In function 'populateStat': LMDB.xs:118:2: error: format not a string literal and no format arguments [-Werror=format-security] ...
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
No, sorry. I have no idea. As I’ve said if it’s not documented you will need to read the source code to understand how
walk()
works.Oh I see, this is helpful information, I’m going to try out something and update later. Thanks!