/** * Remove a note from an object. * * If no note exists, no action is performed. * * This method only updates the map in memory. * * @param noteOn * the object to remove the note from. * @throws java.io.IOException * a portion of the note space is not accessible. */ public void remove(AnyObjectId noteOn) throws IOException { set(noteOn, null); }
dataId = null; set(noteOn, dataId);
/** * Remove a note from an object. * * If no note exists, no action is performed. * * This method only updates the map in memory. * * @param noteOn * the object to remove the note from. * @throws java.io.IOException * a portion of the note space is not accessible. */ public void remove(AnyObjectId noteOn) throws IOException { set(noteOn, null); }
/** * Remove a note from an object. * * If no note exists, no action is performed. * * This method only updates the map in memory. * * @param noteOn * the object to remove the note from. * @throws IOException * a portion of the note space is not accessible. */ public void remove(AnyObjectId noteOn) throws IOException { set(noteOn, null); }
/** {@inheritDoc} */ @Override public Note call() throws GitAPIException { checkCallable(); NoteMap map = NoteMap.newEmptyMap(); RevCommit notesCommit = null; try (RevWalk walk = new RevWalk(repo); ObjectInserter inserter = repo.newObjectInserter()) { Ref ref = repo.findRef(notesRef); // if we have a notes ref, use it if (ref != null) { notesCommit = walk.parseCommit(ref.getObjectId()); map = NoteMap.read(walk.getObjectReader(), notesCommit); } map.set(id, message, inserter); commitNoteMap(repo, notesRef, walk, map, notesCommit, inserter, "Notes added by 'git notes add'"); //$NON-NLS-1$ return map.getNote(id); } catch (IOException e) { throw new JGitInternalException(e.getMessage(), e); } }
/** {@inheritDoc} */ @Override public Note call() throws GitAPIException { checkCallable(); try (RevWalk walk = new RevWalk(repo); ObjectInserter inserter = repo.newObjectInserter()) { NoteMap map = NoteMap.newEmptyMap(); RevCommit notesCommit = null; Ref ref = repo.exactRef(notesRef); // if we have a notes ref, use it if (ref != null) { notesCommit = walk.parseCommit(ref.getObjectId()); map = NoteMap.read(walk.getObjectReader(), notesCommit); } map.set(id, null, inserter); AddNoteCommand.commitNoteMap(repo, notesRef, walk, map, notesCommit, inserter, "Notes removed by 'git notes remove'"); //$NON-NLS-1$ return map.getNote(id); } catch (IOException e) { throw new JGitInternalException(e.getMessage(), e); } }
dataId = null; set(noteOn, dataId);
dataId = null; set(noteOn, dataId);
private void add(T noteRecord) throws MissingObjectException, IncorrectObjectTypeException, IOException, RuntimeException { ObjectId noteContent = createNoteContent(noteRecord); if (ours.contains(reviewCommit)) { // 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 DefaultNoteMerger(); Note newNote = new Note(reviewCommit, noteContent); noteContent = noteMerger.merge(null, newNote, ours.getNote(reviewCommit), reader, inserter).getData(); } ours.set(reviewCommit, noteContent); }
public Note call() throws GitAPIException { checkCallable(); NoteMap map = NoteMap.newEmptyMap(); RevCommit notesCommit = null; try (RevWalk walk = new RevWalk(repo); ObjectInserter inserter = repo.newObjectInserter()) { Ref ref = repo.findRef(notesRef); // if we have a notes ref, use it if (ref != null) { notesCommit = walk.parseCommit(ref.getObjectId()); map = NoteMap.read(walk.getObjectReader(), notesCommit); } map.set(id, message, inserter); commitNoteMap(walk, map, notesCommit, inserter, "Notes added by 'git notes add'"); //$NON-NLS-1$ return map.getNote(id); } catch (IOException e) { throw new JGitInternalException(e.getMessage(), e); } }
public Note call() throws GitAPIException { checkCallable(); try (RevWalk walk = new RevWalk(repo); ObjectInserter inserter = repo.newObjectInserter()) { NoteMap map = NoteMap.newEmptyMap(); RevCommit notesCommit = null; Ref ref = repo.exactRef(notesRef); // if we have a notes ref, use it if (ref != null) { notesCommit = walk.parseCommit(ref.getObjectId()); map = NoteMap.read(walk.getObjectReader(), notesCommit); } map.set(id, null, inserter); commitNoteMap(walk, map, notesCommit, inserter, "Notes removed by 'git notes remove'"); //$NON-NLS-1$ return map.getNote(id); } catch (IOException e) { throw new JGitInternalException(e.getMessage(), e); } }
/** {@inheritDoc} */ @Override public Note call() throws GitAPIException { checkCallable(); NoteMap map = NoteMap.newEmptyMap(); RevCommit notesCommit = null; try (RevWalk walk = new RevWalk(repo); ObjectInserter inserter = repo.newObjectInserter()) { Ref ref = repo.findRef(notesRef); // if we have a notes ref, use it if (ref != null) { notesCommit = walk.parseCommit(ref.getObjectId()); map = NoteMap.read(walk.getObjectReader(), notesCommit); } map.set(id, message, inserter); commitNoteMap(repo, notesRef, walk, map, notesCommit, inserter, "Notes added by 'git notes add'"); //$NON-NLS-1$ return map.getNote(id); } catch (IOException e) { throw new JGitInternalException(e.getMessage(), e); } }
/** {@inheritDoc} */ @Override public Note call() throws GitAPIException { checkCallable(); try (RevWalk walk = new RevWalk(repo); ObjectInserter inserter = repo.newObjectInserter()) { NoteMap map = NoteMap.newEmptyMap(); RevCommit notesCommit = null; Ref ref = repo.exactRef(notesRef); // if we have a notes ref, use it if (ref != null) { notesCommit = walk.parseCommit(ref.getObjectId()); map = NoteMap.read(walk.getObjectReader(), notesCommit); } map.set(id, null, inserter); AddNoteCommand.commitNoteMap(repo, notesRef, walk, map, notesCommit, inserter, "Notes removed by 'git notes remove'"); //$NON-NLS-1$ return map.getNote(id); } catch (IOException e) { throw new JGitInternalException(e.getMessage(), e); } }