diff options
author | David Pursehouse <david.pursehouse@gmail.com> | 2016-07-21 16:07:04 +0900 |
---|---|---|
committer | David Pursehouse <david.pursehouse@gmail.com> | 2016-07-26 10:09:35 +0900 |
commit | 0be80218199afc42d9266ffb1a6ff4fe84bfb28a (patch) | |
tree | b67a724aa54efd9a8bc5c3b6d8b58197de53baeb /org.eclipse.jgit.test | |
parent | a2d3c376a682b540ecd87fe3ff2ffebc1766f938 (diff) | |
parent | df479df17676148bf6391401a704a7d7265c45fa (diff) | |
download | jgit-0be80218199afc42d9266ffb1a6ff4fe84bfb28a.tar.gz jgit-0be80218199afc42d9266ffb1a6ff4fe84bfb28a.zip |
Merge branch 'stable-4.4'
* stable-4.4:
JGit v4.4.1.201607150455-r
RefDirectory: remove ref lock file for following ref dir removal
Change-Id: Ifc8a782efd7f2f991e70ad2a3691a8dba66c7554
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcPackRefsTest.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcPackRefsTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcPackRefsTest.java index 48ea13b98a..ea8dfa2939 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcPackRefsTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcPackRefsTest.java @@ -45,11 +45,14 @@ package org.eclipse.jgit.internal.storage.file; import static java.lang.Integer.valueOf; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertSame; import java.io.File; import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; import java.util.concurrent.BrokenBarrierException; import java.util.concurrent.Callable; import java.util.concurrent.CyclicBarrier; @@ -81,6 +84,17 @@ public class GcPackRefsTest extends GcTestCase { } @Test + public void emptyRefDirectoryDeleted() throws Exception { + String ref = "dir/ref"; + tr.branch(ref).commit().create(); + String name = repo.findRef(ref).getName(); + Path dir = repo.getDirectory().toPath().resolve(name).getParent(); + + gc.packRefs(); + assertFalse(Files.exists(dir)); + } + + @Test public void concurrentOnlyOneWritesPackedRefs() throws Exception { RevBlob a = tr.blob("a"); tr.lightweightTag("t", a); |