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

--skip in combination with --gitignore outputs git errors #1366

Closed
petrem opened this issue Aug 3, 2020 · 1 comment
Closed

--skip in combination with --gitignore outputs git errors #1366

petrem opened this issue Aug 3, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@petrem
Copy link

petrem commented Aug 3, 2020

To reproduce:

~/tmp$ python3 -m venv venv
~/tmp$ source venv/bin/activate
(venv) ~/tmp$ pip install isort==5.2.2
Collecting isort==5.2.2
  Using cached isort-5.2.2-py3-none-any.whl (90 kB)
Installing collected packages: isort
Successfully installed isort-5.2.2
(venv) ~/tmp$ mkdir isort_test
(venv) ~/tmp$ cd isort_test/
(venv) ~/tmp/isort_test$ git init
Initialized empty Git repository in /Users/peter/tmp/isort_test/.git/
(venv) ~/tmp/isort_test$ isort --check --skip foo.py --gitignore .
fatal: this operation must be run in a work tree
fatal: this operation must be run in a work tree
fatal: this operation must be run in a work tree
fatal: this operation must be run in a work tree
fatal: this operation must be run in a work tree
fatal: this operation must be run in a work tree
fatal: this operation must be run in a work tree

Note that adding a .gitignore or the foo.py file does not silence the errors, however isort --check --skip foo.py --skip .git --gitignore . does.

@timothycrosley
Copy link
Member

Thanks for reporting! This is fixed in develop and will make its way out in the 5.3.0 release. In the meantime you can also fix it by adding a --skip .git to your command.

Thanks!

~Timothy

@timothycrosley timothycrosley added the bug Something isn't working label Aug 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants