djLint Version (djlint --version) 1.34 in both cases
template language: N/A, djLint does not open the files
Issue
When running inside a Git worktree, djLint always says No files to check!. In the same repository checked out conventionally, or if the worktree is copied outside its parent Git repository, it works as expected.
How To Reproduce
Create a Git repository and commit an HTML file to a branch.
Run djlint .. It works normally.
Clone that repository with --bare.
Run git worktree add <branch name> and cd into the branch.
Run djlint .. Even though the file is in the current directory, it doen't find it.
Example console session
Success in conventional repository:
(venv) michael@aquinas /tmp $ git init repo
Initialized empty Git repository in /tmp/repo/.git/
(venv) michael@aquinas /tmp $ cd repo/
(venv) michael@aquinas /tmp/repo $ echo '<HTML>' > file.html
(venv) michael@aquinas /tmp/repo $ git add file.html
(venv) michael@aquinas /tmp/repo $ git commit -m 'Add file'
[master (root-commit) c3aadcb] Add file
1 file changed, 1 insertion(+)
create mode 100644 file.html
(venv) michael@aquinas /tmp/repo $ djlint ./
Linting 1/1 files ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 00:00
file.html
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
H005 1:0 Html tag should have lang attribute. <HTML>
H007 1:0 <!DOCTYPE ... > should be present before the html tag. <HTML
H025 1:0 Tag seems to be an orphan. <HTML>
H009 1:1 Tag names should be lowercase. HTML
Linted 1 file, found 4 errors.
Failure in worktree:
(venv) michael@aquinas /tmp/repo $ cd ..
(venv) michael@aquinas /tmp $ git clone repo --bare
Cloning into bare repository 'repo.git'...
done.
(venv) michael@aquinas /tmp $ cd repo.git/
(venv) michael@aquinas /tmp/repo.git $ git worktree add master
Preparing worktree (checking out 'master')
HEAD is now at c3aadcb Add file
(venv) michael@aquinas /tmp/repo.git $ cd master/
(venv) michael@aquinas /tmp/repo.git/master $ ls
file.html
(venv) michael@aquinas /tmp/repo.git/master $ cat file.html
<HTML>
(venv) michael@aquinas /tmp/repo.git/master $ djlint ./
No files to check! 😢
Success if the worktree is copied outside:
(venv) michael@aquinas /tmp/repo.git/master $ cd ..
(venv) michael@aquinas /tmp/repo.git $ cp master/ -r ..
(venv) michael@aquinas /tmp/repo.git $ cd /tmp/master/
(venv) michael@aquinas /tmp/master $ djlint .
Linting 1/1 files ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 00:00
file.html
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
H005 1:0 Html tag should have lang attribute. <HTML>
H007 1:0 <!DOCTYPE ... > should be present before the html tag. <HTML
H025 1:0 Tag seems to be an orphan. <HTML>
H009 1:1 Tag names should be lowercase. HTML
Linted 1 file, found 4 errors.
(venv) michael@aquinas /tmp/master $
Contents of .djlintrc/pyproject.toml [tool.djlint]
N/A, issue is reproducible on a fresh install in a nearly-blank repo.
System Info
djlint --version
) 1.34 in both casesIssue
When running inside a Git worktree, djLint always says
No files to check!
. In the same repository checked out conventionally, or if the worktree is copied outside its parent Git repository, it works as expected.How To Reproduce
djlint .
. It works normally.--bare
.git worktree add <branch name>
andcd
into the branch.djlint .
. Even though the file is in the current directory, it doen't find it.Example console session
Success in conventional repository:
Failure in worktree:
Success if the worktree is copied outside:
Contents of .djlintrc/pyproject.toml [tool.djlint]
N/A, issue is reproducible on a fresh install in a nearly-blank repo.