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


Java Constants.HEAD属性代码示例

本文整理汇总了Java中org.eclipse.jgit.lib.Constants.HEAD属性的典型用法代码示例。如果您正苦于以下问题:Java Constants.HEAD属性的具体用法?Java Constants.HEAD怎么用?Java Constants.HEAD使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.eclipse.jgit.lib.Constants的用法示例。


在下文中一共展示了Constants.HEAD属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getIterator

private AbstractTreeIterator getIterator (String commit, ObjectReader or) throws IOException, GitException {
    Repository repository = getRepository();
    switch (commit) {
        case Constants.HEAD:
            return getHeadIterator(or);
        case GitClient.INDEX:
            return new DirCacheIterator(repository.readDirCache());
        case GitClient.WORKING_TREE:
            return new FileTreeIterator(repository);
        default:
            CanonicalTreeParser p = new CanonicalTreeParser();
            p.reset(or, Utils.findCommit(repository, commit).getTree());
            return p;
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:15,代码来源:ExportDiffCommand.java

示例2: createResult

private GitRebaseResult createResult (RebaseResult res) {
    String currHead;
    Repository repository = getRepository();
    File workTree = repository.getWorkTree();
    try {
        currHead = repository.resolve(Constants.HEAD).name();
    } catch (IOException ex) {
        currHead = Constants.HEAD;
    }
    List<File> conflicts;
    if (res.getStatus() == RebaseResult.Status.STOPPED) {
        conflicts = getConflicts(res.getCurrentCommit());
    } else {
        conflicts = Collections.<File>emptyList();
    }
    return getClassFactory().createRebaseResult(res, conflicts, getFailures(res), currHead);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:RebaseCommand.java

示例3: getBranch

@Override
public String getBranch() {
  try {
    Ref head = git.getRepository().exactRef( Constants.HEAD );
    String branch = git.getRepository().getBranch();
    if ( head.getLeaf().getName().equals( Constants.HEAD ) ) { // if detached
      return Constants.HEAD + " detached at " + branch.substring( 0, 7 );
    } else {
      return branch;
    }
  } catch ( Exception e ) {
    return "";
  }
}
 
开发者ID:HiromuHota,项目名称:pdi-git-plugin,代码行数:14,代码来源:UIGit.java

示例4: ConflictCommand

public ConflictCommand (Repository repository, GitClassFactory gitFactory, File[] roots, ProgressMonitor monitor, StatusListener listener) {
    super(repository, Constants.HEAD, roots, gitFactory, monitor, listener);
    this.monitor = monitor;
    this.listener = listener;
    this.roots = roots;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:6,代码来源:ConflictCommand.java

示例5: getStatus

/**
 * Compares working tree with a given revision and returns an array of
 * statuses for files under given roots
 *
 * @param roots root folders or files to search under
 * @param revision revision to compare with the working tree. If set
 * to <code>null</code> HEAD will be used instead.
 * @return status array
 * @throws GitException an unexpected error occurs
 * @since 1.9
 */
public Map<File, GitStatus> getStatus (File[] roots, String revision, ProgressMonitor monitor) throws GitException {
    Repository repository = gitRepository.getRepository();
    StatusCommand cmd = new StatusCommand(repository, revision == null ? Constants.HEAD : revision,
            roots, getClassFactory(), monitor, delegateListener);
    cmd.execute();
    return cmd.getStatuses();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:18,代码来源:GitClient.java


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