fix: use spawn instead of exec for 'git log' to avoid maxBuffer err
This commit is contained in:
committed by
Stephan Bönnemann
parent
d7f5d19073
commit
73138f8a8f
@@ -1,3 +1,15 @@
|
||||
var mockSpawn = require('mock-spawn')()
|
||||
mockSpawn.setStrategy(function (command, args, opts) {
|
||||
return function (cb) {
|
||||
this.stdout.write(
|
||||
/\.\.HEAD/.test(args.join(' '))
|
||||
? rawCommits[0]
|
||||
: rawCommits.join()
|
||||
)
|
||||
cb(0)
|
||||
}
|
||||
})
|
||||
|
||||
const rawCommits = [
|
||||
'hash-one==SPLIT==commit-one==END==\n',
|
||||
'hash-two==SPLIT==commit-two==END==\n'
|
||||
@@ -12,13 +24,7 @@ module.exports = {
|
||||
if (/notinhistory/.test(command)) return cb(new Error())
|
||||
return cb(null, 'whatever\nmaster\n')
|
||||
}
|
||||
|
||||
cb(
|
||||
null,
|
||||
/\.\.HEAD/.test(command)
|
||||
? rawCommits[0]
|
||||
: rawCommits.join()
|
||||
)
|
||||
},
|
||||
spawn: mockSpawn,
|
||||
'@noCallThru': true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user