Fix CommitUI.getSelectedFiles()
commit76d3d8b89bcaab1a42dfe1d70bca6f330b8291dc
authorThomas Wolf <thomas.wolf@paranor.ch>
Tue, 12 Jun 2018 12:47:19 +0000 (12 14:47 +0200)
committerThomas Wolf <thomas.wolf@paranor.ch>
Mon, 18 Jun 2018 10:07:52 +0000 (18 06:07 -0400)
treee81c1b0deb120a5c983945fd28f8276c000c6dbb
parent60c1ccd8def459d64308531057269afd1841d38d
Fix CommitUI.getSelectedFiles()

This method is used to restrict the files that can be potentially
committed to those covered by the user's resource selection. If a
container is selected, all modified files under that container are
to be included in a commit.

Previous code started off with the modified files as known in git,
then tried to figure out which resource such a file was in Eclipse,
and then checked if that resource was contained by any of the selected
resources. It failed to reliably identify matches when a file appeared
as several resources in the Eclipse resource tree.

The new code swaps the logic around. It starts with the resource
selection and finds the repository-relative paths for all, and then
filters the modified files as known in git.

Bug: 535796
Change-Id: I0b77876ed3913cac987a07444c9de1e6a43e69ee
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitUI.java