Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewFetchAndPushTest.java')
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewFetchAndPushTest.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewFetchAndPushTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewFetchAndPushTest.java
index 77ec5cf2f2..85a4a38349 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewFetchAndPushTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewFetchAndPushTest.java
@@ -11,6 +11,7 @@
package org.eclipse.egit.ui.view.repositories;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import java.io.File;
@@ -175,6 +176,26 @@ public class GitRepositoriesViewFetchAndPushTest extends
}
@Test
+ public void testNoHeadSimplePushDisabled() throws Exception {
+ Repository emptyRepo = createLocalTestRepository("empty");
+ File gitDir = emptyRepo.getDirectory();
+ Activator.getDefault().getRepositoryUtil()
+ .addConfiguredRepository(gitDir);
+ GitRepositoriesViewTestUtils viewUtil = new GitRepositoriesViewTestUtils();
+ SWTBotTree tree = getOrOpenView().bot().tree();
+ SWTBotTreeItem repoItem = viewUtil.getRootItem(tree, gitDir);
+ repoItem.select();
+ boolean enabled = ContextMenuHelper.isContextMenuItemEnabled(tree,
+ NLS.bind(UIText.PushMenu_PushBranch, "master"));
+ assertFalse("Push branch should be disabled if there is no HEAD",
+ enabled);
+ enabled = ContextMenuHelper.isContextMenuItemEnabled(tree,
+ util.getPluginLocalizedValue("PushToUpstreamCommand.label"));
+ assertFalse("Push to upstream should be disabled if there is no HEAD",
+ enabled);
+ }
+
+ @Test
public void testFetchFromOriginFetchNode() throws Exception {
testFetchFromOrigin(false);
}

Back to the top