danger-js: `danger local` git diff error
Hi,
When running danger local --dangerfile dangerfile.js I am getting:
Could not get diff from git between master and HEAD
{ Error: stdout maxBuffer exceeded
at Socket.onChildStdout (child_process.js:325:14)
at Socket.emit (events.js:160:13)
at addChunk (_stream_readable.js:269:12)
at readableAddChunk (_stream_readable.js:252:13)
at Socket.Readable.push (_stream_readable.js:213:10)
at Pipe.onread (net.js:599:20) cmd: 'git diff master...HEAD' }
For branch structure:
master -> develop -> build/danger
About this issue
- Original URL
- State: open
- Created 6 years ago
- Comments: 20 (14 by maintainers)
Yeah, just did that. Fetching itself didn’t create a local ref for
master. Needed to run:git fetch origin master:master. That :master sets the local ref.There is a
--baseoption for danger local. You can use that to provide the base branchYou’re welcome to look at adding a PR which checks master exists, and if not to try main as the base
What if my repo doesn’t contain a master branch??
Additional to the above, and a total edge case, but the following error is raised when the repo is essentially empty (i.e.
git initbut nogit commithas been performed):THANK YOU! That fixed it 😃