# git ls-files should not show worktree files as untracked

1 messages from 2015-10-21 to 2015-10-21. Participants: 乙酸鋰.
Thread: https://gitlist.dev/t/40603

## 乙酸鋰, 2015-10-21 04:58

Subject: git ls-files should not show worktree files as untracked
Message-ID: <CAHtLG6SDrk9Kw2edTVhY2M_8-O09_=VbZhsJYeQXY7No660VDw@mail.gmail.com>
URL: https://gitlist.dev/e/CAHtLG6SDrk9Kw2edTVhY2M_8-O09_%3DVbZhsJYeQXY7No660VDw%40mail.gmail.com

```
Hi,
Using git 2.6.2
I think worktree should behave consistently like submodule

Run following commands
ˋˋˋ
echo 1 > 1.txt
git init
git add 1.txt
git commit -m "initial commit"
echo 2 > 2.txt # untracked file
mkdir def
cd def
git clone --separate-git-dir ../.git/ghi .. . # simulate an untracked submodule
cd ..
git worktree add abc

git ls-files --exclude-standard --full-name --others
ˋˋˋ

Actual: list all the files of abc
2.txt
abc/1.txt
def/

Expected: just the directory of abc
2.txt
abc/
def/


Hint: path.c: git_path_submodule() should read "commondir" ?

```
