Subject: Behavior of git ls-files

From: Steffen Jaeckel <[email-masked]>
Date: Fri, 4 Mar 2011 18:38:31 +0100

Hi,

I want to list all files in a repository that are tracked, but shall be ignored
when following the patterns in .gitignore
I tried to do this by "git ls-files --exclude-standard -i" but it seems as if it
doesn't properly handle directory entries in .gitignore

The following example shall reproduce this issue:

> $ mkdir test
> $ cd test
> $ git init
> $ mkdir testdir
> $ touch testdir/test
> $ git add testdir/test
> $ git commit -m "add test"
> $ echo "testdir/" > .gitignore
> $ git ls-files --exclude-standard -i

Is the behavior of git ls-files correct or not?

Thanks,
Steffen