build
build copied to clipboard
Improve tests for the `git` utility
The git utility uses the git binary to retrieve some repository information and expose them to Build plugins.
In order to unit test this, we are currently targeting a very old commit in @netlify/build.
https://github.com/netlify/build/blob/6621f9d44dd211f6ce3713a0319b08b1dcc59d7b/packages/git-utils/tests/main.js#L7-L12
Instead, we should create a fake .git repository at test-time, then clean it up after the tests exit.
When this happens, we can remove fetch-depth: 0 from GitHub actions.
https://github.com/netlify/build/blob/605ed38cc9771794489d5ec714b125e3a82c3d64/.github/workflows/workflow.yml#L24-L27