From 04b5ae86a4dacfecdd86d7d92c697695fcedfe7b Mon Sep 17 00:00:00 2001 From: Thomas Wolf Date: Sun, 7 Feb 2016 13:59:26 +0100 Subject: Decorate IFolders that are submodule working directory roots Introduce a new configurable submodule text decoration used for folders that are submodule working directory roots. (Or working directory roots of nested repositories.) The default shows the a dirty indicator, the branch, branch state, and the head commit's short message. The repository name is omitted since it'll always be identical to the folder name. Added a new variable for the short message of the head commit. Change-Id: I75460fd59f2e6c9bd06e82a1966e3d06f97ab709 Signed-off-by: Thomas Wolf --- .../ui/internal/submodules/SubmoduleFolderTest.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'org.eclipse.egit.ui.test') diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/submodules/SubmoduleFolderTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/submodules/SubmoduleFolderTest.java index c15b6b156f..320344a6f9 100644 --- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/submodules/SubmoduleFolderTest.java +++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/submodules/SubmoduleFolderTest.java @@ -243,6 +243,24 @@ public class SubmoduleFolderTest extends LocalRepositoryTestCase { }), 5000); } + @Test + public void testDecoration() throws Exception { + SWTBotTree projectExplorerTree = TestUtil.getExplorerTree(); + SWTBotTreeItem node = TestUtil.navigateTo(projectExplorerTree, + childFolder.getFullPath().segments()); + waitForDecorations(); + assertTrue("Folder should have repo/branch decoration", + node.getText().contains("[master")); + node = TestUtil.getChildNode(node.expand(), CHILDPROJECT); + waitForDecorations(); + assertFalse("Folder should not have repo/branch decoration", + node.getText().contains("[")); + node = TestUtil.navigateTo(projectExplorerTree, CHILDPROJECT); + waitForDecorations(); + assertTrue("Project should have subrepo/branch decoration", + node.getText().contains("[child")); + } + @SuppressWarnings("restriction") @Test public void testHistoryFromProjectExplorerIsFromSubRepository() -- cgit v1.2.3