0
내가 여기
JGit힘내 주어진 JGit를 사용하여 노트를 읽는 방법 미트 샤
를 사용하여 저장소에 커밋을 특정의 사용자 정의 심판refs/notes/abcd
에서 망할 놈의주의 사항 정보를 읽으려고하고
내가 뭘하려 :
Repository repository = repositoryManager.openRepository(repoName);
Git git = new Git(repository);
ObjectId oid = repository.resolve("5740b142a7b5f66768a2d904b267dccaef1a095f");
Note note = git.notesShow().setNotesRef("refs/notes/abcd").setObjectId(oid).call();
ObjectLoader loader = repository.open(note.getData());
byte[] data = loader.getBytes();
System.out.println(new String(data, "utf-8"));
나는 다음과 같은 컴파일 오류 얻을 :
error: incompatible types: org.eclipse.jgit.lib.ObjectId cannot be converted to org.eclipse.jgit.revwalk.RevObject
은 어떻게 RevObject
변수가 커밋 샤을 문자열 주어진 setObjectId()
을 힘내을 통과합니까?
도 참조 바로 실행 예 : 예를 들어
/jgit/porcelain/AddAndListNoteOfCommit.java 내 [jgit-cookbook] (https://github.com/centic9/jgit-cookbook/)에 있습니다. – centic