summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.java7
diff options
context:
space:
mode:
authorRobin Rosenberg <robin.rosenberg@dewire.com>2013-07-10 17:33:50 +0200
committerMatthias Sohn <matthias.sohn@sap.com>2014-02-10 23:29:25 +0100
commit1b5bb265dcf88141ef70822a673c948f93d31cd1 (patch)
treedffe8bd986cbd20e0928cbff75311c76a9cbe94d /org.eclipse.jgit.java7
parent7c19c4554466537d0c9e845e9ce99507a500aa87 (diff)
downloadjgit-1b5bb265dcf88141ef70822a673c948f93d31cd1.tar.gz
jgit-1b5bb265dcf88141ef70822a673c948f93d31cd1.zip
Length of symbolic link is the number of bytes, not characters
Change-Id: I6b615f0d5da4339f1f23a29bcaeb80f0346f5764
Diffstat (limited to 'org.eclipse.jgit.java7')
-rw-r--r--org.eclipse.jgit.java7/src/org/eclipse/jgit/util/FileUtil.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/org.eclipse.jgit.java7/src/org/eclipse/jgit/util/FileUtil.java b/org.eclipse.jgit.java7/src/org/eclipse/jgit/util/FileUtil.java
index 428a45f79b..0fd19bcdd1 100644
--- a/org.eclipse.jgit.java7/src/org/eclipse/jgit/util/FileUtil.java
+++ b/org.eclipse.jgit.java7/src/org/eclipse/jgit/util/FileUtil.java
@@ -52,7 +52,7 @@ import java.nio.file.attribute.FileTime;
import java.text.Normalizer;
import java.text.Normalizer.Form;
-import org.eclipse.jgit.util.SystemReader;
+import org.eclipse.jgit.lib.Constants;
class FileUtil {
@@ -113,7 +113,8 @@ class FileUtil {
public static long getLength(File path) throws IOException {
Path nioPath = path.toPath();
if (Files.isSymbolicLink(nioPath))
- return Files.readSymbolicLink(nioPath).toString().length();
+ return Files.readSymbolicLink(nioPath).toString()
+ .getBytes(Constants.CHARSET).length;
return Files.size(nioPath);
}