diff options
author | Adithya Chakilam <quic_achakila@quicinc.com> | 2021-02-18 13:41:19 -0600 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2021-03-14 13:45:29 +0100 |
commit | 0bd2f4bf77c856213e09d656a948e71f71cfd038 (patch) | |
tree | fb36301086599d7c891e2a79fdfa1b48c546b23a /org.eclipse.jgit.junit/src | |
parent | 4a78d911c578a6f9028d6e74b5668dfc384ef80f (diff) | |
download | jgit-0bd2f4bf77c856213e09d656a948e71f71cfd038.tar.gz jgit-0bd2f4bf77c856213e09d656a948e71f71cfd038.zip |
Introduce getMergedInto(RevCommit commit, Collection<Ref> refs)
In cases where we need to determine if a given commit is merged
into many refs, using isMergedInto(base, tip) for each ref would
cause multiple unwanted walks.
getMergedInto() marks the unreachable commits as uninteresting
which would then avoid walking that same path again.
Using the same api, also introduce isMergedIntoAny() and
isMergedIntoAll()
Change-Id: I65de9873dce67af9c415d1d236bf52d31b67e8fe
Signed-off-by: Adithya Chakilam <quic_achakila@quicinc.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.junit/src')
-rw-r--r-- | org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepositoryTestCase.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepositoryTestCase.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepositoryTestCase.java index 64556acc1c..5622108dcd 100644 --- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepositoryTestCase.java +++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepositoryTestCase.java @@ -25,6 +25,7 @@ import java.io.InputStreamReader; import java.io.Reader; import java.nio.file.Path; import java.time.Instant; +import java.util.List; import java.util.Map; import java.util.concurrent.TimeUnit; @@ -39,6 +40,7 @@ import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.lib.FileMode; import org.eclipse.jgit.lib.ObjectId; import org.eclipse.jgit.lib.ObjectInserter; +import org.eclipse.jgit.lib.Ref; import org.eclipse.jgit.lib.RefUpdate; import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.revwalk.RevCommit; @@ -386,6 +388,16 @@ public abstract class RepositoryTestCase extends LocalDiskRepositoryTestCase { } /** + * Get all Refs + * + * @return list of refs + * @throws IOException + */ + public List<Ref> getRefs() throws IOException { + return db.getRefDatabase().getRefs(); + } + + /** * Checkout a branch * * @param branchName |