Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change method of obtaining git root (#3214) #8052

Merged
merged 9 commits into from Mar 19, 2019
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -34,6 +34,7 @@
- `[jest-circus]`: Throw explicit error when errors happen after test is considered complete ([#8005](https://github.com/facebook/jest/pull/8005))
- `[expect]` Remove duck typing and obsolete browser support code when comparing DOM nodes and use DOM-Level-3 API instead ([#7995](https://github.com/facebook/jest/pull/7995))
- `[jest-mock]` Adds a type check to `prototype` to allow mocks of objects with a primitive `prototype` property. ([#8040](https://github.com/facebook/jest/pull/8040))
- `[jest-changed-files]` Change method of obtaining git root (fixes #3214) ([#8052](https://github.com/facebook/jest/pull/8052))

### Chore & Maintenance

Expand Down
4 changes: 2 additions & 2 deletions packages/jest-changed-files/src/git.ts
Expand Up @@ -72,12 +72,12 @@ const adapter: SCMAdapter = {
},

getRoot: async cwd => {
const options = ['rev-parse', '--show-toplevel'];
const options = ['rev-parse', '--show-cdup'];

try {
const result = await execa('git', options, {cwd});

return result.stdout;
return path.join(cwd, result.stdout);
bwiercinski marked this conversation as resolved.
Show resolved Hide resolved
bwiercinski marked this conversation as resolved.
Show resolved Hide resolved
} catch (e) {
return null;
}
Expand Down