本文整理汇总了Java中git4idea.repo.GitRepository.getProject方法的典型用法代码示例。如果您正苦于以下问题:Java GitRepository.getProject方法的具体用法?Java GitRepository.getProject怎么用?Java GitRepository.getProject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类git4idea.repo.GitRepository
的用法示例。
在下文中一共展示了GitRepository.getProject方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkout
import git4idea.repo.GitRepository; //导入方法依赖的package包/类
/**
* {@code git checkout <reference>} <br/>
* {@code git checkout -b <newBranch> <reference>}
*/
@NotNull
@Override
public GitCommandResult checkout(@NotNull GitRepository repository,
@NotNull String reference,
@Nullable String newBranch,
boolean force,
boolean detach,
@NotNull GitLineHandlerListener... listeners) {
final GitLineHandler h = new GitLineHandler(repository.getProject(), repository.getRoot(), GitCommand.CHECKOUT);
h.setSilent(false);
h.setStdoutSuppressed(false);
if (force) {
h.addParameters("--force");
}
if (newBranch == null) { // simply checkout
h.addParameters(detach ? reference + "^0" : reference); // we could use `--detach` here, but it is supported only since 1.7.5.
}
else { // checkout reference as new branch
h.addParameters("-b", newBranch, reference);
}
for (GitLineHandlerListener listener : listeners) {
h.addLineListener(listener);
}
return run(h);
}
示例2: branchDelete
import git4idea.repo.GitRepository; //导入方法依赖的package包/类
/**
* {@code git branch -d <reference>} or {@code git branch -D <reference>}
*/
@NotNull
@Override
public GitCommandResult branchDelete(@NotNull GitRepository repository,
@NotNull String branchName,
boolean force,
@NotNull GitLineHandlerListener... listeners) {
final GitLineHandler h = new GitLineHandler(repository.getProject(), repository.getRoot(), GitCommand.BRANCH);
h.setSilent(false);
h.setStdoutSuppressed(false);
h.addParameters(force ? "-D" : "-d");
h.addParameters(branchName);
for (GitLineHandlerListener listener : listeners) {
h.addLineListener(listener);
}
return run(h);
}
示例3: GitDefineRemoteDialog
import git4idea.repo.GitRepository; //导入方法依赖的package包/类
GitDefineRemoteDialog(@NotNull GitRepository repository, @NotNull Git git) {
super(repository.getProject());
myRepository = repository;
myGit = git;
myRemoteName = new JTextField(GitRemote.ORIGIN_NAME, 20);
myRemoteUrl = new JTextField(20);
setTitle("Define Remote");
init();
}
示例4: config
import git4idea.repo.GitRepository; //导入方法依赖的package包/类
@NotNull
@Override
public GitCommandResult config(@NotNull GitRepository repository, String... params) {
final GitLineHandler h = new GitLineHandler(repository.getProject(), repository.getRoot(), GitCommand.CONFIG);
h.addParameters(params);
return run(h);
}
示例5: stashSave
import git4idea.repo.GitRepository; //导入方法依赖的package包/类
@NotNull
@Override
public GitCommandResult stashSave(@NotNull GitRepository repository, @NotNull String message) {
final GitLineHandler h = new GitLineHandler(repository.getProject(), repository.getRoot(), GitCommand.STASH);
h.addParameters("save");
h.addParameters(message);
return run(h);
}
示例6: stashPop
import git4idea.repo.GitRepository; //导入方法依赖的package包/类
@NotNull
@Override
public GitCommandResult stashPop(@NotNull GitRepository repository, @NotNull GitLineHandlerListener... listeners) {
final GitLineHandler handler = new GitLineHandler(repository.getProject(), repository.getRoot(), GitCommand.STASH);
handler.addParameters("pop");
addListeners(handler, listeners);
return run(handler);
}
示例7: merge
import git4idea.repo.GitRepository; //导入方法依赖的package包/类
@Override
@NotNull
public GitCommandResult merge(@NotNull GitRepository repository, @NotNull String branchToMerge,
@Nullable List<String> additionalParams, @NotNull GitLineHandlerListener... listeners) {
final GitLineHandler mergeHandler = new GitLineHandler(repository.getProject(), repository.getRoot(), GitCommand.MERGE);
mergeHandler.setSilent(false);
mergeHandler.addParameters(branchToMerge);
if (additionalParams != null) {
mergeHandler.addParameters(additionalParams);
}
for (GitLineHandlerListener listener : listeners) {
mergeHandler.addLineListener(listener);
}
return run(mergeHandler);
}
示例8: checkoutNewBranch
import git4idea.repo.GitRepository; //导入方法依赖的package包/类
/**
* {@code git checkout -b <branchName>}
*/
@NotNull
@Override
public GitCommandResult checkoutNewBranch(@NotNull GitRepository repository, @NotNull String branchName,
@Nullable GitLineHandlerListener listener) {
final GitLineHandler h = new GitLineHandler(repository.getProject(), repository.getRoot(), GitCommand.CHECKOUT.readLockingCommand());
h.setSilent(false);
h.setStdoutSuppressed(false);
h.addParameters("-b");
h.addParameters(branchName);
if (listener != null) {
h.addLineListener(listener);
}
return run(h);
}
示例9: createNewTag
import git4idea.repo.GitRepository; //导入方法依赖的package包/类
@NotNull
@Override
public GitCommandResult createNewTag(@NotNull GitRepository repository, @NotNull String tagName,
@Nullable GitLineHandlerListener listener, @NotNull String reference) {
final GitLineHandler h = new GitLineHandler(repository.getProject(), repository.getRoot(), GitCommand.TAG);
h.setSilent(false);
h.addParameters(tagName);
if (!reference.isEmpty()) {
h.addParameters(reference);
}
if (listener != null) {
h.addLineListener(listener);
}
return run(h);
}
示例10: branchContains
import git4idea.repo.GitRepository; //导入方法依赖的package包/类
/**
* Get branches containing the commit.
* {@code git branch --contains <commit>}
*/
@Override
@NotNull
public GitCommandResult branchContains(@NotNull GitRepository repository, @NotNull String commit) {
final GitLineHandler h = new GitLineHandler(repository.getProject(), repository.getRoot(), GitCommand.BRANCH);
h.addParameters("--contains", commit);
return run(h);
}
示例11: branchCreate
import git4idea.repo.GitRepository; //导入方法依赖的package包/类
/**
* Create branch without checking it out.
* {@code git branch <branchName>}
*/
@Override
@NotNull
public GitCommandResult branchCreate(@NotNull GitRepository repository, @NotNull String branchName) {
final GitLineHandler h = new GitLineHandler(repository.getProject(), repository.getRoot(), GitCommand.BRANCH);
h.setStdoutSuppressed(false);
h.addParameters(branchName);
return run(h);
}
示例12: reset
import git4idea.repo.GitRepository; //导入方法依赖的package包/类
@NotNull
private static GitCommandResult reset(@NotNull GitRepository repository, @NotNull String argument, @Nullable String target,
@NotNull GitLineHandlerListener... listeners) {
final GitLineHandler handler = new GitLineHandler(repository.getProject(), repository.getRoot(), GitCommand.RESET);
handler.addParameters(argument);
if (target != null) {
handler.addParameters(target);
}
addListeners(handler, listeners);
return run(handler);
}
示例13: tip
import git4idea.repo.GitRepository; //导入方法依赖的package包/类
/**
* Returns the last (tip) commit on the given branch.<br/>
* {@code git rev-list -1 <branchName>}
*/
@NotNull
@Override
public GitCommandResult tip(@NotNull GitRepository repository, @NotNull String branchName) {
final GitLineHandler h = new GitLineHandler(repository.getProject(), repository.getRoot(), GitCommand.REV_LIST);
h.addParameters("-1");
h.addParameters(branchName);
return run(h);
}
示例14: show
import git4idea.repo.GitRepository; //导入方法依赖的package包/类
@NotNull
@Override
public GitCommandResult show(@NotNull GitRepository repository, @NotNull String... params) {
final GitLineHandler handler = new GitLineHandler(repository.getProject(), repository.getRoot(), GitCommand.SHOW);
handler.addParameters(params);
return run(handler);
}
示例15: cherryPick
import git4idea.repo.GitRepository; //导入方法依赖的package包/类
@Override
@NotNull
public GitCommandResult cherryPick(@NotNull GitRepository repository, @NotNull String hash, boolean autoCommit,
@NotNull GitLineHandlerListener... listeners) {
final GitLineHandler handler = new GitLineHandler(repository.getProject(), repository.getRoot(), GitCommand.CHERRY_PICK);
handler.addParameters("-x");
if (!autoCommit) {
handler.addParameters("-n");
}
handler.addParameters(hash);
addListeners(handler, listeners);
handler.setSilent(false);
handler.setStdoutSuppressed(false);
return run(handler);
}