Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 326180

Summary: EGit does not ignore "foldername/" correct in .gitignore
Product: [Technology] JGit Reporter: Janosch <jp>
Component: JGitAssignee: Marc Strapetz <marc.strapetz>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: caniszczyk, gunnar, matt, matthias.sohn, stefan.lay, waste.manager
Version: unspecified   
Target Milestone: 0.11-M1   
Hardware: All   
OS: All   
Whiteboard:

Description Janosch CLA 2010-09-24 13:55:06 EDT
Build Identifier: 20100617-1415

If you put "foldername/" in your .gitignore file, egit should ignore all directories named "foldername", no matter where they appear in the folder tree. 

For Example if your folder structure looks like this:

root_folder/
 + folder/
      + subfolder/

and you have a .gitignore file in root_folder containing the line "subfolder/", then subfolder should be ignored. Git does that on the command line, EGit does not. Egit shows the folder and its contents still as "untracked" and indicates this with a tiny questionmark.

Reproducible: Always

Steps to Reproduce:
1. Create a directory and a subdir and a subdir within this subdir.
2. Create a .gitignore file in your root dir. Add "dirname/" of the innermost subdir to your .gitignore
3. If you do a commit, all files within this subdir are listed as "untracked"
Comment 1 Jens Baumgart CLA 2010-11-08 04:44:44 EST
- works if the full path is specified in .gitignore: /root_folder/folder/subfolder
- seems to be a problem in WorkingTreeIterator.isEntryIgnored
Comment 2 Chris Aniszczyk CLA 2010-11-08 04:52:00 EST
We should probably come up with a test case for this in JGit and have it fail.
Comment 3 Chris Aniszczyk CLA 2011-01-07 13:13:47 EST
Looks to be fixed with c87ae94c70158ba2bcb310aa242102853d221f11.