/** * Set the parents of this commit. * * @param newParents * the entire list of parents for this commit. */ public void setParentIds(ObjectId... newParents) { parentIds = new ObjectId[newParents.length]; for (int i = 0; i < newParents.length; i++) parentIds[i] = newParents[i].copy(); }
/** * Construct a MissingObjectException for the specified object id. * Expected type is reported to simplify tracking down the problem. * * @param id SHA-1 * @param type object type */ public MissingObjectException(ObjectId id, String type) { super(MessageFormat.format(JGitText.get().missingObject, type, id.name())); missing = id.copy(); }
/** * Add an object to search for. * * @param id * object ID to add. * @return {@code this} * @throws org.eclipse.jgit.errors.MissingObjectException * the object supplied is not available from the object * database. * @throws org.eclipse.jgit.api.errors.JGitInternalException * a low-level exception of JGit has occurred. The original * exception can be retrieved by calling * {@link java.lang.Exception#getCause()}. */ public NameRevCommand add(ObjectId id) throws MissingObjectException, JGitInternalException { checkCallable(); try { walk.parseAny(id); } catch (MissingObjectException e) { throw e; } catch (IOException e) { throw new JGitInternalException(e.getMessage(), e); } revs.add(id.copy()); return this; }
void stored(RefDirectoryUpdate update, FileSnapshot snapshot) { final ObjectId target = update.getNewObjectId().copy(); final Ref leaf = update.getRef().getLeaf(); putLooseRef(new LooseUnpeeled(snapshot, leaf.getName(), target)); }
private static Ref peeledRef(RevWalk walk, ReceiveCommand cmd) throws IOException { ObjectId newId = cmd.getNewId().copy(); RevObject obj = walk.parseAny(newId); if (obj instanceof RevTag) { return new ObjectIdRef.PeeledTag( Ref.Storage.PACKED, cmd.getRefName(), newId, walk.peel(obj).copy()); } return new ObjectIdRef.PeeledNonTag( Ref.Storage.PACKED, cmd.getRefName(), newId); }
/** * Set the parents of this commit. * * @param newParents * the entire list of parents for this commit. */ public void setParentIds(ObjectId... newParents) { parentIds = new ObjectId[newParents.length]; for (int i = 0; i < newParents.length; i++) parentIds[i] = newParents[i].copy(); }
/** * Set the parents of this commit. * * @param newParents * the entire list of parents for this commit. */ public void setParentIds(ObjectId... newParents) { parentIds = new ObjectId[newParents.length]; for (int i = 0; i < newParents.length; i++) parentIds[i] = newParents[i].copy(); }
public CacheRevision(@Nullable ObjectId commitId, Map<String, String> renames, Map<String, CacheChange> fileChange) { this.gitCommitId = commitId == null ? null : commitId.copy(); this.renames.putAll(renames); this.fileChange.putAll(fileChange); }
public TaskKey(@NotNull GitConverter.TaskType type, @Nullable String path, @NotNull ObjectId objectId) { this.type = type; this.path = path; this.objectId = objectId.copy(); if (type.needPath() == (path == null)) { throw new IllegalStateException(); } }
/** * Construct a MissingObjectException for the specified object id. * Expected type is reported to simplify tracking down the problem. * * @param id SHA-1 * @param type object type */ public MissingObjectException(final ObjectId id, final String type) { super(MessageFormat.format(JGitText.get().missingObject, type, id.name())); missing = id.copy(); }
/** * Construct a MissingObjectException for the specified object id. * Expected type is reported to simplify tracking down the problem. * * @param id SHA-1 * @param type object type */ public MissingObjectException(ObjectId id, String type) { super(MessageFormat.format(JGitText.get().missingObject, type, id.name())); missing = id.copy(); }
/** * Add an object to search for. * * @param id * object ID to add. * @return {@code this} * @throws org.eclipse.jgit.errors.MissingObjectException * the object supplied is not available from the object * database. * @throws org.eclipse.jgit.api.errors.JGitInternalException * a low-level exception of JGit has occurred. The original * exception can be retrieved by calling * {@link java.lang.Exception#getCause()}. */ public NameRevCommand add(ObjectId id) throws MissingObjectException, JGitInternalException { checkCallable(); try { walk.parseAny(id); } catch (MissingObjectException e) { throw e; } catch (IOException e) { throw new JGitInternalException(e.getMessage(), e); } revs.add(id.copy()); return this; }
/** * Add an object to search for. * * @param id * object ID to add. * @return {@code this} * @throws MissingObjectException * the object supplied is not available from the object * database. * @throws JGitInternalException * a low-level exception of JGit has occurred. The original * exception can be retrieved by calling * {@link Exception#getCause()}. */ public NameRevCommand add(ObjectId id) throws MissingObjectException, JGitInternalException { checkCallable(); try { walk.parseAny(id); } catch (MissingObjectException e) { throw e; } catch (IOException e) { throw new JGitInternalException(e.getMessage(), e); } revs.add(id.copy()); return this; }
void stored(RefDirectoryUpdate update, FileSnapshot snapshot) { final ObjectId target = update.getNewObjectId().copy(); final Ref leaf = update.getRef().getLeaf(); putLooseRef(new LooseUnpeeled(snapshot, leaf.getName(), target)); }
void stored(RefDirectoryUpdate update, FileSnapshot snapshot) { final ObjectId target = update.getNewObjectId().copy(); final Ref leaf = update.getRef().getLeaf(); putLooseRef(new LooseUnpeeled(snapshot, leaf.getName(), target)); }
private static Ref peeledRef(RevWalk walk, ReceiveCommand cmd) throws IOException { ObjectId newId = cmd.getNewId().copy(); RevObject obj = walk.parseAny(newId); if (obj instanceof RevTag) { return new ObjectIdRef.PeeledTag( Ref.Storage.PACKED, cmd.getRefName(), newId, walk.peel(obj).copy()); } return new ObjectIdRef.PeeledNonTag( Ref.Storage.PACKED, cmd.getRefName(), newId); }