Codota Logo
GitRemoteBranch
Code IndexAdd Codota to your IDE (free)

How to use
GitRemoteBranch
in
git4idea

Best Java code snippets using git4idea.GitRemoteBranch (Showing top 10 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Charset c =
  • Codota IconString charsetName;Charset.forName(charsetName)
  • Codota IconCharset.defaultCharset()
  • Codota IconContentType contentType;contentType.getCharset()
  • Smart code suggestions by Codota
}
origin: Microsoft/azure-devops-intellij

public static GitRemoteBranch createRemoteBranch(final String name, final GitRemote remote) {
  GitRemoteBranch branch = mock(GitRemoteBranch.class);
  when(branch.getName()).thenReturn("refs/remotes/" + name);
  when(branch.getFullName()).thenReturn(name);
  when(branch.isRemote()).thenReturn(true);
  when(branch.getRemote()).thenReturn(remote);
  when(branch.getNameForLocalOperations()).thenReturn(name);
  when(branch.getNameForRemoteOperations()).thenReturn(name);
  return branch;
}
origin: uwolfer/gerrit-intellij-plugin

  @Override
  public String apply(GitRemoteBranch branch) {
    return branch.getNameForRemoteOperations();
  }
});
origin: Microsoft/azure-devops-intellij

@Before
public void setUp() throws Exception {
  PowerMockito.mockStatic(VcsNotifier.class);
  when(VcsNotifier.getInstance(mockProject)).thenReturn(mockVcsNotifier);
  PowerMockito.mockStatic(GeneralGitHelper.class);
  when(GeneralGitHelper.getLastCommitHash(mockProject, mockGitRepository, mockRemoteMaster)).thenReturn("281e2d5f8ba36655570ba808055e81ff64ba14d8");
  when(mockGitRepository.getRemotes()).thenReturn(ImmutableList.of(tfsRemoteBranch1, tfsRemoteBranch2, tfsRemoteMaster));
  when(mockGitRepository.getInfo()).thenReturn(mockGitRepoInfo);
  when(mockRemoteMaster.getRemote()).thenReturn(tfsRemoteMaster);
  when(mockRemoteMaster.getName()).thenReturn("master");
  when(mockRemoteBranch1.getRemote()).thenReturn(tfsRemoteBranch1);
  when(mockRemoteBranch1.getName()).thenReturn("branch1");
  when(mockRemoteBranch2.getRemote()).thenReturn(tfsRemoteBranch2);
  when(mockRemoteBranch2.getName()).thenReturn("branch2");
  when(mockVstsRepo.getId()).thenReturn(UUID.fromString("00000000-0000-0000-0000-000000000000"));
  when(mockTeamProjectReference.getId()).thenReturn(UUID.fromString("00000000-0000-0000-0000-000000000000"));
  when(mockGitRepoInfo.getRemoteBranches()).thenReturn(ImmutableList.of(mockRemoteMaster));
  when(mockContext.getUri()).thenReturn(uri);
  when(mockContext.getGitRepository()).thenReturn(mockVstsRepo);
  when(mockContext.getTeamProjectReference()).thenReturn(mockTeamProjectReference);
}
origin: Microsoft/azure-devops-intellij

@Test
public void testConstructor_MasterSelected() {
  when(mockGitRepoInfo.getRemoteBranches()).thenReturn(ImmutableList.of(mockRemoteBranch1, mockRemoteMaster));
  underTest = new CreateBranchModel(mockProject, defaultBranchName, mockGitRepository);
  assertNotNull(underTest.getRemoteBranchDropdownModel());
  assertEquals(2, underTest.getRemoteBranchDropdownModel().getSize());
  assertEquals("master", underTest.getSelectedRemoteBranch().getName());
}
origin: uwolfer/gerrit-intellij-plugin

  public String getQuery() {
    if (branch.isPresent()) {
      return String.format("(project:%s+branch:%s)",
          getNameForRepository(repository),
          branch.get().getNameForRemoteOperations());
    } else {
      return String.format("project:%s", getNameForRepository(repository));
    }
  }
}
origin: Microsoft/azure-devops-intellij

@Test
public void testConstructor_NoMasterToSelect() {
  when(mockGitRepoInfo.getRemoteBranches()).thenReturn(ImmutableList.of(mockRemoteBranch1, mockRemoteBranch2));
  underTest = new CreateBranchModel(mockProject, defaultBranchName, mockGitRepository);
  assertNotNull(underTest.getRemoteBranchDropdownModel());
  assertEquals(2, underTest.getRemoteBranchDropdownModel().getSize());
  assertEquals("branch2", underTest.getSelectedRemoteBranch().getName());
}
origin: uwolfer/gerrit-intellij-plugin

  @Override
  public void actionPerformed(AnActionEvent e) {
    value = Optional.of(new BranchDescriptor(repository, branch));
    updateFilterValueLabel(String.format("%s (%s)", branch.getNameForRemoteOperations(), getNameForRepository(repository)));
    setChanged();
    notifyObservers(project);
  }
});
origin: Microsoft/azure-devops-intellij

Assert.assertEquals("origin/master", model.getTargetBranch().getName());
origin: uwolfer/gerrit-intellij-plugin

public GerritPushTargetPanel(@NotNull GitRepository repository, @Nullable GitPushTarget defaultTarget, GerritPushOptionsPanel gerritPushOptionsPanel) {
  super(repository, defaultTarget);
  String initialBranch = null;
  if (defaultTarget != null) {
    initialBranch = defaultTarget.getBranch().getNameForRemoteOperations();
  }
  gerritPushOptionsPanel.getGerritPushExtensionPanel().registerGerritPushTargetPanel(this, initialBranch);
}
origin: uwolfer/gerrit-intellij-plugin

Collections.sort(branches, ordering);
for (final GitRemoteBranch branch : branches) {
  if (!branch.getNameForRemoteOperations().equals("HEAD")) {
    group.add(new DumbAwareAction(branch.getNameForRemoteOperations()) {
      @Override
      public void actionPerformed(AnActionEvent e) {
git4ideaGitRemoteBranch

Most used methods

  • getName
  • getNameForRemoteOperations
  • getFullName
  • getNameForLocalOperations
  • getRemote
  • isRemote

Popular in Java

  • Making http post requests using okhttp
  • compareTo (BigDecimal)
  • getContentResolver (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • MessageFormat (java.text)
    MessageFormat provides a means to produce concatenated messages in language-neutral way. Use this to
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now