aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.junit
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2024-11-11 23:39:12 +0100
committerMatthias Sohn <matthias.sohn@sap.com>2024-11-11 23:39:12 +0100
commit102733833c29ff84c093d54dc0554a1f73f89078 (patch)
tree3b7d36f8986f807dda9059037612dfd87b866557 /org.eclipse.jgit.junit
parent9ed2e5c473e8334a20846e7fa0f5eb0aa369f0bb (diff)
parentd34f8b523638fc95b2e7006d02c9f6a756cbba85 (diff)
downloadjgit-102733833c29ff84c093d54dc0554a1f73f89078.tar.gz
jgit-102733833c29ff84c093d54dc0554a1f73f89078.zip
Merge branch 'stable-6.10' into stable-7.0
* stable-6.10: 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: If05b0d474c728b54cab9af2b7416be30b2754d1b
Diffstat (limited to 'org.eclipse.jgit.junit')
-rw-r--r--org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java10
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);