summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.pgm
diff options
context:
space:
mode:
authorMarc Strapetz <marc.strapetz@syntevo.com>2010-07-29 16:21:37 +0200
committerShawn O. Pearce <spearce@spearce.org>2010-08-20 18:03:07 -0700
commite2e38792b5403da38d5e3ab0e15b626e051107f2 (patch)
tree147cc47a9772a8d7af72814b8f9dc239ee27605b /org.eclipse.jgit.pgm
parent2b23aac1c01f1df0d22d1ef052b87d9c462e6b77 (diff)
downloadjgit-e2e38792b5403da38d5e3ab0e15b626e051107f2.tar.gz
jgit-e2e38792b5403da38d5e3ab0e15b626e051107f2.zip
Perform automatic CRLF to LF conversion during WorkingTreeIterator
WorkingTreeIterator now optionally performs CRLF to LF conversion for text files. A basic framework is left in place to support enabling (or disabling) this feature based on gitattributes, and also to support the more generic smudge/clean filter system. As there is no gitattribute support yet in JGit this is left unimplemented, but the mightNeedCleaning(), isBinary() and filterClean() methods will provide reasonable places to plug that into in the future. [sp: All bugs inside of WorkingTreeIterator are my fault, I wrote most of it while cherry-picking this patch and building it on top of Marc's original work.] CQ: 4419 Bug: 301775 Change-Id: I0ca35cfbfe3f503729cbfc1d5034ad4abcd1097e Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'org.eclipse.jgit.pgm')
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/AbstractTreeIteratorHandler.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/AbstractTreeIteratorHandler.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/AbstractTreeIteratorHandler.java
index 712698200e..8d0b504c37 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/AbstractTreeIteratorHandler.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/opt/AbstractTreeIteratorHandler.java
@@ -64,6 +64,7 @@ import org.eclipse.jgit.pgm.CLIText;
import org.eclipse.jgit.treewalk.AbstractTreeIterator;
import org.eclipse.jgit.treewalk.CanonicalTreeParser;
import org.eclipse.jgit.treewalk.FileTreeIterator;
+import org.eclipse.jgit.treewalk.WorkingTreeOptions;
import org.eclipse.jgit.util.FS;
/**
@@ -96,7 +97,7 @@ public class AbstractTreeIteratorHandler extends
final String name = params.getParameter(0);
if (new File(name).isDirectory()) {
- setter.addValue(new FileTreeIterator(new File(name), FS.DETECTED));
+ setter.addValue(new FileTreeIterator(new File(name), FS.DETECTED, WorkingTreeOptions.createDefaultInstance()));
return 1;
}