threads / discuss / 40603

git ls-files should not show worktree files as untracked

Subject: git ls-files should not show worktree files as untracked

## tl;dr

One message between Oct 21, 2015 and Oct 21, 2015.

replies: 0people: 1as markdown or json

乙酸鋰· Oct 21, 2015, 04:58 UTC · lore

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" ?

← back to recent threads