use of jetbrains.buildServer.vcs.VcsRoot in project teamcity-git by JetBrains.
the class GitVcsRootTest method fetch_url_for_repository_in_local_filesystem_should_not_contain_password.
public void fetch_url_for_repository_in_local_filesystem_should_not_contain_password() throws Exception {
String pathInLocalFS = "/path/in/local/fs";
VcsRoot root = vcsRoot().withFetchUrl(pathInLocalFS).withAuthMethod(AuthenticationMethod.PASSWORD).withUsername("user").withPassword("pass").build();
GitVcsRoot s = new GitVcsRoot(myMirrorManager, root, new URIishHelperImpl());
assertEquals(new URIish(pathInLocalFS), s.getRepositoryFetchURL().get());
}
use of jetbrains.buildServer.vcs.VcsRoot in project teamcity-git by JetBrains.
the class MapFullPathTest method bulk.
public void bulk() throws Exception {
// clone repository for myRoot and root3
RepositoryStateData state0 = RepositoryStateData.createSingleVersionState("a7274ca8e024d98c7d59874f19f21d26ee31d41d");
RepositoryStateData state1 = myGit.getCurrentState(myRoot);
myGit.getCollectChangesPolicy().collectChanges(myRoot, state0, state1, CheckoutRules.DEFAULT);
// tracks same repo as myRoot1
VcsRoot root3 = vcsRoot().withId(3).withFetchUrl(myRemoteRepositoryDir.getAbsolutePath()).build();
// tracks same repo as myRoot2
VcsRoot root4 = vcsRoot().withId(4).withFetchUrl(myRemoteRepositoryDir2.getAbsolutePath()).build();
List<Boolean> result = myGit.checkSuitable(asList(new VcsRootEntry(myRoot, new CheckoutRules("-:dir1")), new VcsRootEntry(myRoot, new CheckoutRules("+:dir1")), new VcsRootEntry(myRoot, new CheckoutRules("+:dir2")), new VcsRootEntry(myRoot2, new CheckoutRules("+:dir2")), new VcsRootEntry(root3, new CheckoutRules("+:dir1")), new VcsRootEntry(root4, new CheckoutRules("+:dir4")), new VcsRootEntry(root3, new CheckoutRules("+:dir5")), new VcsRootEntry(root4, new CheckoutRules("+:dir6"))), asList(// affects root and root3
"a7274ca8e024d98c7d59874f19f21d26ee31d41d-add81050184d3c818560bdd8839f50024c188586||dir1/text1.txt", // affects no repo
"abababababababababababababababababababab||."));
then(result).containsExactly(false, true, false, false, true, false, false, false);
}
use of jetbrains.buildServer.vcs.VcsRoot in project teamcity-git by JetBrains.
the class GitPatchTest method submodules_and_checkout_rules3.
@TestFor(issues = "TW-50097")
@Test(dataProvider = "patchInSeparateProcess")
public void submodules_and_checkout_rules3(boolean patchInSeparateProcess) throws Exception {
myConfigBuilder.setSeparateProcessForPatch(patchInSeparateProcess);
VcsRoot root = getRoot("sub-submodule", true);
checkPatch(root, "submodules_and_checkout_rules3", null, "ce6044093939bb47283439d97a1c80f759669ff5", new CheckoutRules("-:first-level-submodule/sub-sub/file.txt"));
}
use of jetbrains.buildServer.vcs.VcsRoot in project teamcity-git by JetBrains.
the class GitPatchTest method submodules_and_checkout_rules.
@TestFor(issues = "TW-50097")
@Test(dataProvider = "patchInSeparateProcess")
public void submodules_and_checkout_rules(boolean patchInSeparateProcess) throws Exception {
myConfigBuilder.setSeparateProcessForPatch(patchInSeparateProcess);
VcsRoot root = getRoot("sub-submodule", true);
checkPatch(root, "submodules_and_checkout_rules", null, "ce6044093939bb47283439d97a1c80f759669ff5", new CheckoutRules("+:first-level-submodule"));
}
use of jetbrains.buildServer.vcs.VcsRoot in project teamcity-git by JetBrains.
the class GitPatchTest method build_patch_should_respect_autocrlf.
@TestFor(issues = "TW-16530")
@Test(dataProvider = "patchInSeparateProcess")
public void build_patch_should_respect_autocrlf(boolean patchInSeparateProcess) throws Exception {
myConfigBuilder.setSeparateProcessForPatch(patchInSeparateProcess);
VcsRoot root = vcsRoot().withAutoCrlf(true).withFetchUrl(myMainRepositoryDir.getAbsolutePath()).build();
setExpectedSeparator("\r\n");
checkPatch(root, "patch-eol", null, "465ad9f630e451b9f2b782ffb09804c6a98c4bb9", new CheckoutRules("-:dir"));
String content = new String(getSupport().getContentProvider().getContent("readme.txt", root, "465ad9f630e451b9f2b782ffb09804c6a98c4bb9"));
assertEquals(content, "Test repository for teamcity.change 1\r\nadd feature\r\n");
}
Aggregations