Package org.eclipse.jgit.notes

Examples of org.eclipse.jgit.notes.Note


          } catch (IncorrectObjectTypeException e) {
            result.notACommit(commitToBan, e.getMessage());
            continue;
          }

          final Note note = ourNoteMap.getNote(commitToBan);
          if (note != null) {
            result.commitAlreadyBanned(commitToBan);
            continue;
          }
View Full Code Here


   * @return note
   * @throws Exception
   */
  protected Note note(String content, String ref) throws Exception {
    Git git = Git.open(testRepo);
    Note note = git.notesAdd().setMessage(content)
        .setNotesRef(Constants.R_NOTES + ref)
        .setObjectId(CommitUtils.getHead(git.getRepository())).call();
    assertNotNull(note);
    return note;
  }
View Full Code Here

  @Override
  public boolean include(final RevWalk walker, final RevCommit commit)
      throws IOException {
    show.setObjectId(commit);
    final int refLength = noteRefs.length;
    Note note = null;
    for (int i = 0; i < refLength; i++) {
      try {
        note = show.setNotesRef(noteRefs[i]).call();
      } catch (GitAPIException e) {
        throwIOException(e, "Exception showing notes");
View Full Code Here

  }

  @Test
  public void testAddAndRemoveNote() throws Exception {
    git.notesAdd().setObjectId(commit2).setMessage("data").call();
    Note note = git.notesShow().setObjectId(commit2).call();
    String content = new String(db.open(note.getData()).getCachedBytes(),
        "UTF-8");
    assertEquals(content, "data");

    git.notesRemove().setObjectId(commit2).call();
View Full Code Here

      // merge the existing and the new note as if they are both new
      // means: base == null
      // there is not really a common ancestry for these two note revisions
      // use the same NoteMerger that is used from the NoteMapMerger
      NoteMerger noteMerger = new ReviewNoteMerger();
      Note newNote = new Note(c, noteContent);
      noteContent = noteMerger.merge(null, newNote, ours.getNote(c),
          reader, inserter).getData();
    }
    ours.set(c, noteContent);
  }
View Full Code Here

        lo.openStream(),
        new ByteArrayInputStream(sep),
        lt.openStream());
    ObjectId noteData = inserter.insert(Constants.OBJ_BLOB,
        lo.getSize() + sep.length + lt.getSize(), union);
    return new Note(ours, noteData);
  }
View Full Code Here

        Repository repo = getRepository();
        Git git = Git.wrap(repo);
        RevCommit revCommit = getRevCommit();
        for (Ref ref : repo.getRefDatabase().getRefs(Constants.R_NOTES)
            .values()) {
          Note note = git.notesShow().setNotesRef(ref.getName())
              .setObjectId(revCommit).call();
          if (note != null)
            noteList.add(new RepositoryCommitNote(this, ref, note));
        }
        notes = noteList.toArray(new RepositoryCommitNote[noteList
View Full Code Here

TOP

Related Classes of org.eclipse.jgit.notes.Note

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.