本文整理汇总了Java中org.eclipse.jgit.lib.Constants.OBJ_TREE属性的典型用法代码示例。如果您正苦于以下问题:Java Constants.OBJ_TREE属性的具体用法?Java Constants.OBJ_TREE怎么用?Java Constants.OBJ_TREE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.jgit.lib.Constants
的用法示例。
在下文中一共展示了Constants.OBJ_TREE属性的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;
}
示例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;
}
示例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;
}
示例4: getType
@Override
public final int getType() {
return Constants.OBJ_TREE;
}