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


Java Constants.OBJ_COMMIT属性代码示例

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


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

示例1: getType

private GitObjectType getType (RevObject object) {
    GitObjectType objType = GitObjectType.UNKNOWN;
    if (object != null) {
        switch (object.getType()) {
            case Constants.OBJ_COMMIT:
                objType = GitObjectType.COMMIT;
                break;
            case Constants.OBJ_BLOB:
                objType = GitObjectType.BLOB;
                break;
            case Constants.OBJ_TAG:
                objType = GitObjectType.TAG;
                break;
            case Constants.OBJ_TREE:
                objType = GitObjectType.TREE;
                break;
        }
    }
    return objType;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:GitTag.java

示例2: lookupAny

/**
 * Locate a reference to any object without loading it.
 * <p>
 * The object may or may not exist in the repository. It is impossible to
 * tell from this method's return value.
 *
 * @param id
 *            name of the object.
 * @param type
 *            type of the object. Must be a valid Git object type.
 * @return reference to the object. Never null.
 */
public RevObject lookupAny(final AnyObjectId id, final int type) {
	RevObject r = objects.get(id);
	if (r == null) {
		switch (type) {
		case Constants.OBJ_COMMIT:
			r = createCommit(id);
			break;
		case Constants.OBJ_TREE:
			r = new RevTree(id);
			break;
		case Constants.OBJ_BLOB:
			r = new RevBlob(id);
			break;
		case Constants.OBJ_TAG:
			r = new RevTag(id);
			break;
		default:
			throw new IllegalArgumentException(MessageFormat.format(
					JGitText.get().invalidGitType, Integer.valueOf(type)));
		}
		objects.add(r);
	}
	return r;
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:36,代码来源:RevWalk.java

示例3: parseNew

private RevObject parseNew(AnyObjectId id, ObjectLoader ldr)
		throws LargeObjectException, CorruptObjectException,
		MissingObjectException, IOException {
	RevObject r;
	int type = ldr.getType();
	switch (type) {
	case Constants.OBJ_COMMIT: {
		final RevCommit c = createCommit(id);
		c.parseCanonical(this, getCachedBytes(c, ldr));
		r = c;
		break;
	}
	case Constants.OBJ_TREE: {
		r = new RevTree(id);
		r.flags |= PARSED;
		break;
	}
	case Constants.OBJ_BLOB: {
		r = new RevBlob(id);
		r.flags |= PARSED;
		break;
	}
	case Constants.OBJ_TAG: {
		final RevTag t = new RevTag(id);
		t.parseCanonical(this, getCachedBytes(t, ldr));
		r = t;
		break;
	}
	default:
		throw new IllegalArgumentException(MessageFormat.format(
				JGitText.get().badObjectType, Integer.valueOf(type)));
	}
	objects.add(r);
	return r;
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:35,代码来源:RevWalk.java

示例4: getType

@Override
public final int getType() {
	return Constants.OBJ_COMMIT;
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:4,代码来源:RevCommit.java


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