本文整理汇总了Java中git4idea.checkout.GitCheckoutProvider类的典型用法代码示例。如果您正苦于以下问题:Java GitCheckoutProvider类的具体用法?Java GitCheckoutProvider怎么用?Java GitCheckoutProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GitCheckoutProvider类属于git4idea.checkout包,在下文中一共展示了GitCheckoutProvider类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: clone
import git4idea.checkout.GitCheckoutProvider; //导入依赖的package包/类
@When("I clone (\\S+)")
public void I_clone_the_repository(final String url) {
myAuthenticator = new TestAuthenticator();
myHttpAuthService.register(myAuthenticator);
executeOnPooledThread(new Runnable() {
@Override
public void run() {
String projectName = url.substring(url.lastIndexOf('/') + 1).replace(".git", "");
GitCheckoutProvider.doClone(myProject, myGit, projectName, myTestRoot, url);
myCloneCompleted.countDown();
}
});
}
示例2: doCheckout
import git4idea.checkout.GitCheckoutProvider; //导入依赖的package包/类
@Override
public void doCheckout(@NotNull Project project, @Nullable Listener listener) {
if (!GitUtils.testGitExecutable(project)) return;
BasicAction.saveAll();
List<Application> applicationList;
CcApi ccApi = CcApi.getInstance(project);
ccApi.login();
applicationList = getApplicationsFromOrga(project);
if (applicationList == null || applicationList.size() == 0) {
Messages.showMessageDialog("No application is currently linked with you application. Impossible to clone and create a project.",
"No Application Available", Messages.getErrorIcon());
return;
}
final CleverClone dialog = new CleverClone(project, applicationList);
if (!dialog.showAndGet()) return;
final VirtualFile destinationParent = LocalFileSystem.getInstance().findFileByIoFile(new File(dialog.getParentDirectory()));
if (destinationParent == null) return;
final String sourceRepositoryURL = dialog.getRepositoryUrl();
final String directoryName = dialog.getDirectoryName();
final String parentDirectory = dialog.getParentDirectory();
Git git = ServiceManager.getService(Git.class);
GitCheckoutProvider.clone(project, git, listener, destinationParent, sourceRepositoryURL, directoryName, parentDirectory);
}
示例3: clone
import git4idea.checkout.GitCheckoutProvider; //导入依赖的package包/类
@When("I clone (\\S+)")
public void I_clone_the_repository(final String url) {
myAuthenticator = new TestAuthenticator();
myHttpAuthService.register(myAuthenticator);
executeOnPooledThread(new Runnable() {
@Override
public void run() {
String projectName = url.substring(url.lastIndexOf('/') + 1).replace(".git", "");
GitCheckoutProvider.doClone(myProject, new EmptyProgressIndicator(), myGit, projectName, myTestRoot, url);
myCloneCompleted.countDown();
}
});
}
示例4: doCheckout
import git4idea.checkout.GitCheckoutProvider; //导入依赖的package包/类
@Override
public void doCheckout(@NotNull final Project project, @Nullable final Listener listener) {
if (!GithubUtil.testGitExecutable(project)) {
return;
}
BasicAction.saveAll();
List<GithubRepo> availableRepos;
try {
availableRepos = GithubUtil
.computeValueInModal(project, "Access to GitHub", new ThrowableConvertor<ProgressIndicator, List<GithubRepo>, IOException>() {
@NotNull
@Override
public List<GithubRepo> convert(ProgressIndicator indicator) throws IOException {
return GithubUtil.runTask(project, GithubAuthDataHolder.createFromSettings(), indicator,
new ThrowableConvertor<GithubConnection, List<GithubRepo>, IOException>() {
@NotNull
@Override
public List<GithubRepo> convert(@NotNull GithubConnection connection) throws IOException {
return GithubApiUtil.getAvailableRepos(connection);
}
}
);
}
});
}
catch (IOException e) {
GithubNotifications.showError(project, "Couldn't get the list of GitHub repositories", e);
return;
}
Collections.sort(availableRepos, new Comparator<GithubRepo>() {
@Override
public int compare(final GithubRepo r1, final GithubRepo r2) {
final int comparedOwners = r1.getUserName().compareTo(r2.getUserName());
return comparedOwners != 0 ? comparedOwners : r1.getName().compareTo(r2.getName());
}
});
final GitCloneDialog dialog = new GitCloneDialog(project);
// Add predefined repositories to history
dialog.prependToHistory("-----------------------------------------------");
for (int i = availableRepos.size() - 1; i >= 0; i--) {
dialog.prependToHistory(GithubUrlUtil.getCloneUrl(availableRepos.get(i).getFullPath()));
}
if (!dialog.showAndGet()) {
return;
}
dialog.rememberSettings();
final VirtualFile destinationParent = LocalFileSystem.getInstance().findFileByIoFile(new File(dialog.getParentDirectory()));
if (destinationParent == null) {
return;
}
final String sourceRepositoryURL = dialog.getSourceRepositoryURL();
final String directoryName = dialog.getDirectoryName();
final String parentDirectory = dialog.getParentDirectory();
Git git = ServiceManager.getService(Git.class);
GitCheckoutProvider.clone(project, git, listener, destinationParent, sourceRepositoryURL, directoryName, parentDirectory);
}
示例5: getCheckoutProvider
import git4idea.checkout.GitCheckoutProvider; //导入依赖的package包/类
@Override
public CheckoutProvider getCheckoutProvider() {
return new GitCheckoutProvider(ServiceManager.getService(Git.class));
}