Search in sources :

Example 1 with AdvertiseRefsHook

use of org.eclipse.jgit.transport.AdvertiseRefsHook in project gerrit by GerritCodeReview.

the class RefAdvertisementIT method getReceivePackRefs.

private TestRefAdvertiser.Result getReceivePackRefs() throws Exception {
    try (Repository repo = repoManager.openRepository(project)) {
        AdvertiseRefsHook adv = ReceiveCommitsAdvertiseRefsHookChain.createForTest(queryProvider, project, identifiedUserFactory.create(admin.id()));
        ReceivePack rp = new ReceivePack(repo);
        rp.setAdvertiseRefsHook(adv);
        TestRefAdvertiser advertiser = new TestRefAdvertiser(repo);
        rp.sendAdvertisedRefs(advertiser);
        return advertiser.result();
    }
}
Also used : TestRepository(org.eclipse.jgit.junit.TestRepository) Repository(org.eclipse.jgit.lib.Repository) AdvertiseRefsHook(org.eclipse.jgit.transport.AdvertiseRefsHook) TestRefAdvertiser(com.google.gerrit.server.git.receive.testing.TestRefAdvertiser) ReceivePack(org.eclipse.jgit.transport.ReceivePack)

Aggregations

TestRefAdvertiser (com.google.gerrit.server.git.receive.testing.TestRefAdvertiser)1 TestRepository (org.eclipse.jgit.junit.TestRepository)1 Repository (org.eclipse.jgit.lib.Repository)1 AdvertiseRefsHook (org.eclipse.jgit.transport.AdvertiseRefsHook)1 ReceivePack (org.eclipse.jgit.transport.ReceivePack)1