Exemple #1
0
    CommitBuilder(CommitBuilder prior) throws Exception {
      branch = prior.branch;

      DirCacheBuilder b = tree.builder();
      for (int i = 0; i < prior.tree.getEntryCount(); i++) b.add(prior.tree.getEntry(i));
      b.finish();

      parents.add(prior.create());
    }
Exemple #2
0
 /**
  * Forcefully update this branch to a particular commit.
  *
  * @param to the commit to update to.
  * @return {@code to}.
  * @throws Exception
  */
 public RevCommit update(CommitBuilder to) throws Exception {
   return update(to.create());
 }
Exemple #3
0
 /**
  * Update a reference to point to an object.
  *
  * @param ref the name of the reference to update to. If {@code ref} does not start with {@code
  *     refs/} and is not the magic names {@code HEAD} {@code FETCH_HEAD} or {@code MERGE_HEAD},
  *     then {@code refs/heads/} will be prefixed in front of the given name, thereby assuming it
  *     is a branch.
  * @param to the target object.
  * @return the target object.
  * @throws Exception
  */
 public RevCommit update(String ref, CommitBuilder to) throws Exception {
   return update(ref, to.create());
 }