From 803debd7be76a2f18624254409228433c9c329f2 Mon Sep 17 00:00:00 2001 From: Jevgeni Zelenkov Date: Mon, 6 Aug 2012 08:59:28 +0200 Subject: Ensure a directory exists before trying to create/merge a file into it. Since git doesn't keep track of empty directories, they should be created first. Test case included demonstrates that using StashApplyCommand(). Bugfix is applied to the DirCacheCheckout class, because StashApplyCommand() uses it internally to apply a stash. Change-Id: Iac259229ef919f9e92e7e51a671d877172bb88a8 Signed-off-by: Jevgeni Zelenkov Signed-off-by: Matthias Sohn --- .../tst/org/eclipse/jgit/lib/RepositoryTestCase.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'org.eclipse.jgit.test/tst/org/eclipse/jgit/lib') diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RepositoryTestCase.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RepositoryTestCase.java index c06322e8e4..457fd1a7ef 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RepositoryTestCase.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RepositoryTestCase.java @@ -102,6 +102,12 @@ public abstract class RepositoryTestCase extends LocalDiskRepositoryTestCase { return JGitTestUtil.writeTrashFile(db, name, data); } + protected File writeTrashFile(final String subdir, final String name, + final String data) + throws IOException { + return JGitTestUtil.writeTrashFile(db, subdir, name, data); + } + protected void deleteTrashFile(final String name) throws IOException { JGitTestUtil.deleteTrashFile(db, name); } -- cgit v1.2.3