aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.junit/src
diff options
context:
space:
mode:
authorDemetr Starshov <dstarshov@google.com>2020-08-11 17:57:10 -0700
committerDemetr Starshov <dstarshov@google.com>2020-08-26 18:39:38 -0700
commite60ea7324f37bd0a1086e27fad52ecc5232e9c06 (patch)
tree164c49cee87c8538358d29e09f000cb0aac5fe86 /org.eclipse.jgit.junit/src
parent86aa6deff4b452881876c78aaab09ddbb5c7531b (diff)
downloadjgit-e60ea7324f37bd0a1086e27fad52ecc5232e9c06.tar.gz
jgit-e60ea7324f37bd0a1086e27fad52ecc5232e9c06.zip
ResolveMerger: Adding test cases for GITLINK merge
Add test cases which cover content-merge resolve logic. Git clients try to agressively merge blobs by content, but GITLINK types of entries can't be merged with each other or with blobs. This change ensures all possible permutations which can trigger blob and GITLINK content merge are covered. Signed-off-by: Demetr Starshov <dstarshov@google.com> Change-Id: I7e83a28a14d4d2f9e0ba2b1cffbf3224fb7f3fef
Diffstat (limited to 'org.eclipse.jgit.junit/src')
-rw-r--r--org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepositoryTestCase.java16
1 files changed, 16 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 de11e2c004..cc84f197aa 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
@@ -34,6 +34,7 @@ import org.eclipse.jgit.dircache.DirCacheBuilder;
import org.eclipse.jgit.dircache.DirCacheCheckout;
import org.eclipse.jgit.dircache.DirCacheEntry;
import org.eclipse.jgit.internal.storage.file.FileRepository;
+import org.eclipse.jgit.lib.AnyObjectId;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.FileMode;
import org.eclipse.jgit.lib.ObjectId;
@@ -513,6 +514,21 @@ public abstract class RepositoryTestCase extends LocalDiskRepositoryTestCase {
}
/**
+ * Create <code>DirCacheEntry</code>
+ *
+ * @param path
+ * @param objectId
+ * @return the DirCacheEntry
+ */
+ protected DirCacheEntry createGitLink(String path, AnyObjectId objectId) {
+ final DirCacheEntry entry = new DirCacheEntry(path,
+ DirCacheEntry.STAGE_0);
+ entry.setFileMode(FileMode.GITLINK);
+ entry.setObjectId(objectId);
+ return entry;
+ }
+
+ /**
* Assert files are equal
*
* @param expected