use of jetbrains.buildServer.vcs.VcsRoot in project teamcity-git by JetBrains.
the class GitPatchTest method submodules_and_checkout_rules2.
@TestFor(issues = "TW-50097")
@Test(dataProvider = "patchInSeparateProcess")
public void submodules_and_checkout_rules2(boolean patchInSeparateProcess) throws Exception {
myConfigBuilder.setSeparateProcessForPatch(patchInSeparateProcess);
VcsRoot root = getRoot("sub-submodule", true);
checkPatch(root, "submodules_and_checkout_rules2", null, "ce6044093939bb47283439d97a1c80f759669ff5", new CheckoutRules("+:first-level-submodule/sub-sub"));
}
use of jetbrains.buildServer.vcs.VcsRoot in project teamcity-git by JetBrains.
the class GitVcsRootTest method disabling_custom_clones.
@TestFor(issues = "TW-36401")
public void disabling_custom_clones() throws Exception {
File cloneDir = new File("");
VcsRoot root = vcsRoot().withRepositoryPathOnServer(cloneDir.getAbsolutePath()).withFetchUrl("http://some.org/repo").build();
GitVcsRoot gitRoot1 = new GitVcsRoot(myMirrorManager, root, new URIishHelperImpl());
assertTrue(FileUtil.isAncestor(myDefaultCachesDir, gitRoot1.getRepositoryDir(), true));
setInternalProperty(Constants.CUSTOM_CLONE_PATH_ENABLED, "true");
GitVcsRoot gitRoot2 = new GitVcsRoot(myMirrorManager, root, new URIishHelperImpl());
assertEquals(cloneDir.getAbsoluteFile(), gitRoot2.getRepositoryDir());
}
use of jetbrains.buildServer.vcs.VcsRoot in project teamcity-git by JetBrains.
the class GitVcsRootTest method cred_prod.
public void cred_prod() throws Exception {
VcsRoot root = vcsRoot().withFetchUrl("git://git@some.org/repository.git").build();
GitVcsRoot gitRoot = new GitVcsRoot(myMirrorManager, root, new URIishHelperImpl());
assertNull("User is not stripped from the url with anonymous protocol", gitRoot.getRepositoryFetchURL().getUser());
}
use of jetbrains.buildServer.vcs.VcsRoot in project teamcity-git by JetBrains.
the class GitLabelingSupportTest method testLabels.
public void testLabels() throws Exception {
VcsRoot root = vcsRoot().withFetchUrl(getRemoteRepositoryDir("repo.git")).build();
// ensure that all revisions reachable from master are fetched
buildGit().getLabelingSupport().label("test_label", "2276eaf76a658f96b5cf3eb25f3e1fda90f6b653", root, CheckoutRules.DEFAULT);
Repository r = new RepositoryBuilder().setGitDir(getRemoteRepositoryDir("repo.git")).build();
RevWalk revWalk = new RevWalk(r);
try {
Ref tagRef = r.getTags().get("test_label");
RevTag t = revWalk.parseTag(tagRef.getObjectId());
assertEquals(t.getObject().name(), "2276eaf76a658f96b5cf3eb25f3e1fda90f6b653");
} finally {
r.close();
}
}
use of jetbrains.buildServer.vcs.VcsRoot in project teamcity-git by JetBrains.
the class GitLabelingSupportTest method tag_with_specified_username.
@Test
public void tag_with_specified_username() throws Exception {
VcsRoot root = vcsRoot().withFetchUrl(GitUtils.toURL(getRemoteRepositoryDir("repo.git"))).withUsernameForTags("John Doe <john.doe@some.org>").build();
buildGit().getLabelingSupport().label("label_with_specified_username", "465ad9f630e451b9f2b782ffb09804c6a98c4bb9", root, CheckoutRules.DEFAULT);
Repository r = new RepositoryBuilder().setGitDir(getRemoteRepositoryDir("repo.git")).build();
RevWalk revWalk = new RevWalk(r);
try {
Ref tagRef = r.getTags().get("label_with_specified_username");
RevTag t = revWalk.parseTag(tagRef.getObjectId());
PersonIdent tagger = t.getTaggerIdent();
assertEquals(tagger.getName(), "John Doe");
assertEquals(tagger.getEmailAddress(), "john.doe@some.org");
} finally {
revWalk.close();
r.close();
}
}
Aggregations