本文整理匯總了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());
}