當前位置: 首頁>>代碼示例>>Java>>正文


Java ObjectId.fromString方法代碼示例

本文整理匯總了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;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:19,代碼來源:CherryPickCommand.java

示例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());
	}
}
 
開發者ID:jmfgdev,項目名稱:gitplex-mit,代碼行數:19,代碼來源:GitUtils.java

示例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());
}
 
開發者ID:jmfgdev,項目名稱:gitplex-mit,代碼行數:6,代碼來源:ObjectIdDeserializer.java


注:本文中的org.eclipse.jgit.lib.ObjectId.fromString方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。