aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.lfs.test/tst/org/eclipse/jgit
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jgit.lfs.test/tst/org/eclipse/jgit')
-rw-r--r--org.eclipse.jgit.lfs.test/tst/org/eclipse/jgit/lfs/LfsGitTest.java23
1 files changed, 22 insertions, 1 deletions
diff --git a/org.eclipse.jgit.lfs.test/tst/org/eclipse/jgit/lfs/LfsGitTest.java b/org.eclipse.jgit.lfs.test/tst/org/eclipse/jgit/lfs/LfsGitTest.java
index 8964310e41..3e83c8ef49 100644
--- a/org.eclipse.jgit.lfs.test/tst/org/eclipse/jgit/lfs/LfsGitTest.java
+++ b/org.eclipse.jgit.lfs.test/tst/org/eclipse/jgit/lfs/LfsGitTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021, Thomas Wolf <thomas.wolf@paranor.ch> and others
+ * Copyright (C) 2021, 2022 Thomas Wolf <thomas.wolf@paranor.ch> and others
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0 which is available at
@@ -68,6 +68,27 @@ public class LfsGitTest extends RepositoryTestCase {
}
@Test
+ public void testBranchSwitch() throws Exception {
+ git.branchCreate().setName("abranch").call();
+ git.checkout().setName("abranch").call();
+ File aFile = writeTrashFile("a.bin", "aaa");
+ writeTrashFile(".gitattributes", "a.bin filter=lfs");
+ git.add().addFilepattern(".").call();
+ git.commit().setMessage("acommit").call();
+ git.checkout().setName("master").call();
+ git.branchCreate().setName("bbranch").call();
+ git.checkout().setName("bbranch").call();
+ File bFile = writeTrashFile("b.bin", "bbb");
+ writeTrashFile(".gitattributes", "b.bin filter=lfs");
+ git.add().addFilepattern(".").call();
+ git.commit().setMessage("bcommit").call();
+ git.checkout().setName("abranch").call();
+ checkFile(aFile, "aaa");
+ git.checkout().setName("bbranch").call();
+ checkFile(bFile, "bbb");
+ }
+
+ @Test
public void checkoutNonLfsPointer() throws Exception {
String content = "size_t\nsome_function(void* ptr);\n";
File smallFile = writeTrashFile("Test.txt", content);