diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2024-11-11 23:55:18 +0100 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2024-11-12 00:01:17 +0100 |
commit | 0dfc30951b5753b3966051c70e5b1c3860fd9fc5 (patch) | |
tree | 43f77d02536195ee7165d8b55eff931362586d35 /org.eclipse.jgit.junit/src | |
parent | 7c889ac7ecb7e04010016d5a3c1e381235c3430b (diff) | |
parent | 102733833c29ff84c093d54dc0554a1f73f89078 (diff) | |
download | jgit-0dfc30951b5753b3966051c70e5b1c3860fd9fc5.tar.gz jgit-0dfc30951b5753b3966051c70e5b1c3860fd9fc5.zip |
Merge branch 'stable-7.0'
* stable-7.0:
Replace custom encoder Constants#encodeASCII by JDK implementation
Replace custom encoder `Constants#encode` by JDK implementation
Add `numberOfPackFilesAfterBitmap` to RepoStatistics
Enhance CommitBuilder#parent to tolerate null parent
Change-Id: I46f961144f2e3c4c57ef0f63a9c8954fee8133e9
Diffstat (limited to 'org.eclipse.jgit.junit/src')
-rw-r--r-- | org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java index a2e0a571eb..66cf739ef1 100644 --- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java +++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java @@ -30,6 +30,7 @@ import java.util.List; import java.util.Set; import java.util.TimeZone; +import org.eclipse.jgit.annotations.Nullable; import org.eclipse.jgit.api.Git; import org.eclipse.jgit.dircache.DirCache; import org.eclipse.jgit.dircache.DirCacheBuilder; @@ -1144,15 +1145,18 @@ public class TestRepository<R extends Repository> implements AutoCloseable { } /** - * set parent commit + * Set parent commit * * @param p - * parent commit + * parent commit, can be {@code null} * @return this commit builder * @throws Exception * if an error occurred */ - public CommitBuilder parent(RevCommit p) throws Exception { + public CommitBuilder parent(@Nullable RevCommit p) throws Exception { + if (p == null) { + return this; + } if (parents.isEmpty()) { DirCacheBuilder b = tree.builder(); parseBody(p); |