Bug 580478 - git clean "include ignored resources" does not clean files with names starting with directory name
Summary: git clean "include ignored resources" does not clean files with names startin...
Status: RESOLVED FIXED
Alias: None
Product: JGit
Classification: Technology
Component: JGit (show other bugs)
Version: 6.3   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: 6.3   Edit
Assignee: Thomas Wolf CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-07-29 07:54 EDT by Jörg Kubitz CLA
Modified: 2022-08-03 05:55 EDT (History)
1 user (show)

See Also:


Attachments
Example Screenshot.png (37.45 KB, image/png)
2022-07-29 07:54 EDT, Jörg Kubitz CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jörg Kubitz CLA 2022-07-29 07:54:54 EDT
Created attachment 288652 [details]
Example Screenshot.png

Given a directory containing a directory "a"
Then all files who's name starts also with "a" are not cleaned. For example ignored "a.txt" - while "b.txt" is correctly cleaned.
The clean-dialog just does not show them. And as they are not selectable they are not cleaned.

Note the options "Include ignored resources" is used.

When using also the option "Clean selected untracked files *and directories*" the empty directory "a" is cleaned. A second call of the clean dialog will then show and clean "a.txt" too.
Comment 1 Thomas Wolf CLA 2022-07-29 18:35:10 EDT
JGit's CleanCommand uses String.startsWith(), which doesn't work to determine whether one path is a prefix of another path.
Comment 2 Eclipse Genie CLA 2022-07-31 08:41:20 EDT
New Gerrit change created: https://git.eclipse.org/r/c/jgit/jgit/+/194944
Comment 4 Jörg Kubitz CLA 2022-08-03 05:55:38 EDT
thanks @Thomas!