use of org.eclipse.che.api.git.params.RemoteUpdateParams in project che by eclipse.
the class RemoteUpdateTest method testUpdateBranches.
@Test(dataProvider = "GitConnectionFactory", dataProviderClass = GitConnectionFactoryProvider.class)
public void testUpdateBranches(GitConnectionFactory connectionFactory) throws GitException, IOException {
//given
GitConnection connection = connectToGitRepositoryWithContent(connectionFactory, repository);
addInitialRemote(connection);
//when
//change branch1 to branch2
RemoteUpdateParams request = RemoteUpdateParams.create("newRemote").withBranches(singletonList("branch2"));
connection.remoteUpdate(request);
//then
assertEquals(parseAllConfig(connection).get("remote.newRemote.fetch").get(0), "+refs/heads/branch2:refs/remotes/newRemote/branch2");
}
Aggregations