当前位置: 首页>>代码示例>>Java>>正文


Java GitRepository.getProject方法代码示例

本文整理汇总了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 &lt;reference&gt;} <br/>
 * {@code git checkout -b &lt;newBranch&gt; &lt;reference&gt;}
 */
@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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:GitImpl.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:GitImpl.java

示例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();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:GitDefineRemoteDialog.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:GitImpl.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:GitImpl.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:GitImpl.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:GitImpl.java

示例8: checkoutNewBranch

import git4idea.repo.GitRepository; //导入方法依赖的package包/类
/**
 * {@code git checkout -b &lt;branchName&gt;}
 */
@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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:GitImpl.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:GitImpl.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:GitImpl.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:GitImpl.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:GitImpl.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:GitImpl.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:GitImpl.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:GitImpl.java


注:本文中的git4idea.repo.GitRepository.getProject方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。