threads / discuss / 53258

ls-files -o -i --directory omits files/directories

Subject: ls-files -o -i --directory omits files/directories

## tl;dr

One message between Apr 20, 2020 and Apr 20, 2020.

replies: 0people: 1as markdown or json

Jakub Horodecki· Apr 20, 2020, 08:03 UTC · lore
Hello

I found a case for git ls-files I suspect might be a bug. For the following example repository structure:

.
|--   InnerDir
|     |--   excluded.txt
|--   file1.txt
|--   .gitignore

and the .gitignore content: InnerDir/*

the command
git ls-files -oi --exclude-standard --directory

returns no results, that is neither "InnerDir/" directory nor "InnerDir/excluded.txt" file. I would expect one of the entries since at the moment information about the file is missing completely in the listing. Both executing the command without --directory flag and adding "InnerDir" to .gitignore produce some output from the command.

So the command returns no results for --others excluded files if --directory flag is specified and all files in a directory are ignored (but directory itself is not). Is this actually a bug or I misunderstood something?

I tested it on latest release of Git for Windows (2.26.1.windows.1, x64).

Best Regards Jakub Horodecki

← back to recent threads