本文整理汇总了Java中org.eclipse.jgit.lib.ObjectId.fromString方法的典型用法代码示例。如果您正苦于以下问题:Java ObjectId.fromString方法的具体用法?Java ObjectId.fromString怎么用?Java ObjectId.fromString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jgit.lib.ObjectId
的用法示例。
在下文中一共展示了ObjectId.fromString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getOriginalCommit
import org.eclipse.jgit.lib.ObjectId; //导入方法依赖的package包/类
private ObjectId getOriginalCommit () throws GitException {
Repository repository = getRepository();
File seqHead = new File(getSequencerFolder(), SEQUENCER_HEAD);
ObjectId originalCommitId = null;
if (seqHead.canRead()) {
try {
byte[] content = IO.readFully(seqHead);
if (content.length > 0) {
originalCommitId = ObjectId.fromString(content, 0);
}
if (originalCommitId != null) {
originalCommitId = repository.resolve(originalCommitId.getName() + "^{commit}");
}
} catch (IOException e) {
}
}
return originalCommitId;
}
示例2: getMergeBase
import org.eclipse.jgit.lib.ObjectId; //导入方法依赖的package包/类
/**
* @return
* merge base of specified commits, or <tt>null</tt> if two commits do not have related history. In this
* case, these two commits can not be merged
*/
@Nullable
public static ObjectId getMergeBase(Repository repository1, ObjectId commit1,
Repository repository2, ObjectId commit2, @Nullable String fetchRef) {
if (repository1.getDirectory()!=null && repository1.getDirectory().equals(repository2.getDirectory())) {
return GitUtils.getMergeBase(repository1, commit1, commit2);
} else {
fetch(repository2, commit2, repository1, fetchRef);
return ObjectId.fromString(new CalcMergeBaseCommand(repository1.getDirectory())
.rev1(commit1.name())
.rev2(commit2.name())
.call());
}
}
示例3: deserialize
import org.eclipse.jgit.lib.ObjectId; //导入方法依赖的package包/类
@Override
public ObjectId deserialize(JsonParser jp, DeserializationContext ctxt)
throws IOException, JsonProcessingException {
return ObjectId.fromString(jp.getValueAsString());
}