소스 검색

Add toByteArray to CommitBuilder, TreeBuilder

This better matches the existing API of TreeFormatter, but is just a
simple delegation to build().

Change-Id: I188f43acc34455e773d63836724b05e18f5c7a84
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Reviewed-by: Chris Aniszczyk <caniszczyk@gmail.com>
tags/v0.10.1
Shawn O. Pearce 13 년 전
부모
커밋
9ad802c15b
2개의 변경된 파일23개의 추가작업 그리고 0개의 파일을 삭제
  1. 13
    0
      org.eclipse.jgit/src/org/eclipse/jgit/lib/CommitBuilder.java
  2. 10
    0
      org.eclipse.jgit/src/org/eclipse/jgit/lib/TagBuilder.java

+ 13
- 0
org.eclipse.jgit/src/org/eclipse/jgit/lib/CommitBuilder.java 파일 보기

@@ -310,6 +310,19 @@ public class CommitBuilder {
return os.toByteArray();
}

/**
* Format this builder's state as a commit object.
*
* @return this object in the canonical commit format, suitable for storage
* in a repository.
* @throws UnsupportedEncodingException
* the encoding specified by {@link #getEncoding()} is not
* supported by this Java runtime.
*/
public byte[] toByteArray() throws UnsupportedEncodingException {
return build();
}

@Override
public String toString() {
StringBuilder r = new StringBuilder();

+ 10
- 0
org.eclipse.jgit/src/org/eclipse/jgit/lib/TagBuilder.java 파일 보기

@@ -193,6 +193,16 @@ public class TagBuilder {
return os.toByteArray();
}

/**
* Format this builder's state as an annotated tag object.
*
* @return this object in the canonical annotated tag format, suitable for
* storage in a repository.
*/
public byte[] toByteArray() {
return build();
}

@Override
public String toString() {
StringBuilder r = new StringBuilder();

Loading…
취소
저장