Uploaded image for project: 'WildFly Core'
  1. WildFly Core
  2. WFCORE-7303

GitRepository.clearExistingFiles removes file in the 'ignored' set

XMLWordPrintable

      GitRepository.clearExistingFiles works with a Set<String> of 'ignored' paths in order to not delete paths that are unrelated to the paths managed via the git repository. But those strings are actually in the syntax appropriate for a .gitignore file and include things like * and ! chars. (The set is also used to provide content for a generated .gitignore file; that seems to be its primary purpose.) But GitRepository.clearExistingFiles attempts to do simple string matching of path segments against the entries in the set. This isn't reliable as any entry with '*' or '!' will not match.

      I believe this can result in deleting some data dir content and a configuration/logging.properties file.

      I don't know the practical impact of this, i.e. I've not heard of user reports of problems this causes so perhaps in real-world use cases it doesn't matter. I noticed this by digging into the code to fix WFCORE-7026.

              ehugonne1@redhat.com Emmanuel Hugonnet
              bstansbe@redhat.com Brian Stansberry
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: