Search in sources :

Example 1 with DiffParams

use of org.eclipse.che.api.git.params.DiffParams in project che by eclipse.

the class DiffTest method testDiffRawWithCommits.

@Test(dataProvider = "GitConnectionFactory", dataProviderClass = org.eclipse.che.git.impl.GitConnectionFactoryProvider.class)
public void testDiffRawWithCommits(GitConnectionFactory connectionFactory) throws GitException, IOException {
    //given
    GitConnection connection = connectToInitializedGitRepository(connectionFactory, repository);
    makeCommitInMaster(connection);
    connection.add(AddParams.create(singletonList("aaa")));
    connection.rm(RmParams.create(singletonList("README.txt")));
    connection.commit(CommitParams.create("testDiffNameStatusWithCommits"));
    //when
    DiffParams params = DiffParams.create().withFileFilter(null).withType(DiffType.RAW).withNoRenames(false).withRenameLimit(0).withCommitA("HEAD^1").withCommitB("HEAD");
    DiffPage diffPage = connection.diff(params);
    //then
    diffPage.writeTo(System.out);
}
Also used : GitConnection(org.eclipse.che.api.git.GitConnection) DiffPage(org.eclipse.che.api.git.DiffPage) DiffParams(org.eclipse.che.api.git.params.DiffParams) Test(org.testng.annotations.Test)

Example 2 with DiffParams

use of org.eclipse.che.api.git.params.DiffParams in project che by eclipse.

the class DiffTest method testDiffRaw.

@Test(dataProvider = "GitConnectionFactory", dataProviderClass = org.eclipse.che.git.impl.GitConnectionFactoryProvider.class)
public void testDiffRaw(GitConnectionFactory connectionFactory) throws GitException, IOException {
    //given
    GitConnection connection = connectToInitializedGitRepository(connectionFactory, repository);
    makeCommitInMaster(connection);
    //when
    DiffParams params = DiffParams.create().withFileFilter(null).withType(DiffType.RAW).withNoRenames(false).withRenameLimit(0);
    DiffPage diffPage = connection.diff(params);
    //then
    diffPage.writeTo(System.out);
}
Also used : GitConnection(org.eclipse.che.api.git.GitConnection) DiffPage(org.eclipse.che.api.git.DiffPage) DiffParams(org.eclipse.che.api.git.params.DiffParams) Test(org.testng.annotations.Test)

Aggregations

DiffPage (org.eclipse.che.api.git.DiffPage)2 GitConnection (org.eclipse.che.api.git.GitConnection)2 DiffParams (org.eclipse.che.api.git.params.DiffParams)2 Test (org.testng.annotations.Test)2