diff options
author | Christian Halstrick <christian.halstrick@sap.com> | 2017-04-24 14:33:47 +0200 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2017-05-10 00:33:44 +0200 |
commit | 501af12c19a4f7dfa0b22e46cdf19cc306370565 (patch) | |
tree | c52e875188015a0c79ac0ac66ab2daeb4b711c6f /org.eclipse.jgit.test/tst/org/eclipse | |
parent | 5b84e25fa3afe66bbfa7eb953ea0bd332c745ecd (diff) | |
download | jgit-501af12c19a4f7dfa0b22e46cdf19cc306370565.tar.gz jgit-501af12c19a4f7dfa0b22e46cdf19cc306370565.zip |
Checkout should not use too long filenames
DirCacheCheckout is generating names for temporary files. It was not checking
the length of this filenames. It may happen that a generated filename is
longer than 255 chars which causes problems on certain platforms. Make sure
that filenames for temporary files do not exceed 255 chars.
Bug: 508823
Change-Id: I9475c04351ce3faebdc6ad40ea4faa3c326815f4
Diffstat (limited to 'org.eclipse.jgit.test/tst/org/eclipse')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutTest.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutTest.java index 75b574e92c..f8c2d4536d 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutTest.java @@ -1672,6 +1672,20 @@ public class DirCacheCheckoutTest extends RepositoryTestCase { } } + @Test + public void testLongFilename() throws Exception { + char[] bytes = new char[253]; + Arrays.fill(bytes, 'f'); + String longFileName = new String(bytes); + // 1 + doit(mkmap(longFileName, "a"), mkmap(longFileName, "b"), + mkmap(longFileName, "a")); + writeTrashFile(longFileName, "a"); + checkout(); + assertNoConflicts(); + assertUpdated(longFileName); + } + public void assertWorkDir(Map<String, String> i) throws CorruptObjectException, IOException { |