Bug 383221 - EGit not ignoring .gitignore directories with trailing slash (/)
Summary: EGit not ignoring .gitignore directories with trailing slash (/)
Status: NEW
Alias: None
Product: EGit
Classification: Technology
Component: Core (show other bugs)
Version: 1.3   Edit
Hardware: PC Linux
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-21 08:48 EDT by Przemek Wesolek CLA
Modified: 2012-06-21 09:02 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Przemek Wesolek CLA 2012-06-21 08:48:41 EDT
Build Identifier: Version: 3.7.0 Build id: I20110613-1736

The project has a directory 'tmp' with files in it. None of the files in 'tmp' is commited. In .gitignore there is a line:

  /tmp/

However, when trying to commit, EGit displays 'tmp' as unknown resource.

Removing the trailing slash resolves the problem, but according to gitignore manpage:

    If the pattern ends with a slash, it is removed for the purpose of the following description, but it would only find a match with a directory. In other words, foo/ will match a directory foo and paths underneath it, but will not match a regular file or a symbolic link foo (this is consistent with the way how pathspec works in general in git).


So, '/tmp/' should ignore 'tmp' dir, as '/tmp' does.


Reproducible: Always
Comment 1 Przemek Wesolek CLA 2012-06-21 09:02:27 EDT
Hm, things are a bit more complicated.

The .gitignore pattern '/tmp/' is not working *only* when there is another repo in tmp.

So, if the directory structure looks like

    .git/
    tmp/
        .git
        someotherfile
    other
        no-.git-files-here

and .gitignore looks like

    /tmp/
    /other/

EGit will (correctly) ignore 'other' and (incorrectly) not ignore 'tmp'.