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

getChangedFilesForRoots returns things that aren't files #7956

Closed
jumoel opened this issue Feb 22, 2019 · 4 comments · Fixed by #7961
Closed

getChangedFilesForRoots returns things that aren't files #7956

jumoel opened this issue Feb 22, 2019 · 4 comments · Fixed by #7961

Comments

@jumoel
Copy link
Contributor

jumoel commented Feb 22, 2019

🐛 Bug Report

getChangedFilesForRoots in jest-changed-files returns things that aren't files.
More specifically, it returns lines from commit messages instead.

To Reproduce

$ git clone https://github.com/jumoel/jest-changed-files-bug
$ cd jest-changed-files-bug && yarn && node index.js

Verify that lines from the commit message are present in the output:

{ changedFiles:
   Set {
     '~/test/another line',
     '~/test/yet another one',
     '~/test/.gitignore',
     '~/test/index.js',
     '~/test/package.json',
     '~/test/yarn.lock' },
  repos: { git: Set { '~/test' }, hg: Set {} } }

Expected behavior

The changedFiles should not contain items that are not files (another line and yet another one specifically).

Link to repl or repo (highly encouraged)

https://github.com/jumoel/jest-changed-files-bug

Run npx envinfo --preset jest

Paste the results here:

  System:
    OS: macOS 10.14.3
    CPU: (4) x64 Intel(R) Core(TM) i5-7600 CPU @ 3.50GHz
  Binaries:
    Node: 10.14.1 - ~/.nvm/versions/node/v10.14.1/bin/node
    Yarn: 1.13.0 - /usr/local/bin/yarn
    npm: 6.7.0 - ~/.nvm/versions/node/v10.14.1/bin/npm
@SimenB
Copy link
Member

SimenB commented Feb 22, 2019

huh, weird we haven't noticed that? We probably do a file filter later inside of Jest. Wanna send a PR fixing it?

@jumoel
Copy link
Contributor Author

jumoel commented Feb 22, 2019

Yep, wouldn't mind. 👍

One solution is to change the git command to --pretty="format:". Another is to do a file filter.

Which would you prefer?

@SimenB
Copy link
Member

SimenB commented Feb 22, 2019

I don't have a preference, whatever's fastest/most readable 🙂

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants