Merge branch 'stable-4.5' * stable-4.5: pgm: Fix misspelled key of an externalized string Add missing online help for Ketch server type option in CLI daemon Remove wrong junit dependencies in org.eclipse.jgit.pgm Change-Id: I9cac024c0b488101b539c713b0f5ffc8c01b55bd Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
diff --git a/.buckconfig b/.buckconfig index 8d2572b..7986494 100644 --- a/.buckconfig +++ b/.buckconfig
@@ -12,6 +12,8 @@ [java] src_roots = src, resources, tst + source_level = 8 + target_level = 8 [project] ignore = .git
diff --git a/org.eclipse.jgit.ant.test/.classpath b/org.eclipse.jgit.ant.test/.classpath index 098194c..eca7bdb 100644 --- a/org.eclipse.jgit.ant.test/.classpath +++ b/org.eclipse.jgit.ant.test/.classpath
@@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <classpath> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> <classpathentry kind="src" path="src"/> <classpathentry kind="output" path="bin"/>
diff --git a/org.eclipse.jgit.ant.test/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.ant.test/.settings/org.eclipse.jdt.core.prefs index 87210fb..10c29d5 100644 --- a/org.eclipse.jgit.ant.test/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.jgit.ant.test/.settings/org.eclipse.jdt.core.prefs
@@ -7,9 +7,9 @@ org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate @@ -112,7 +112,7 @@ org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=error -org.eclipse.jdt.core.compiler.source=1.7 +org.eclipse.jdt.core.compiler.source=1.8 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
diff --git a/org.eclipse.jgit.ant.test/META-INF/MANIFEST.MF b/org.eclipse.jgit.ant.test/META-INF/MANIFEST.MF index ef8ed89..29526a8 100644 --- a/org.eclipse.jgit.ant.test/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.ant.test/META-INF/MANIFEST.MF
@@ -3,14 +3,14 @@ Bundle-ManifestVersion: 2 Bundle-Name: %plugin_name Bundle-SymbolicName: org.eclipse.jgit.ant.test -Bundle-Version: 4.5.1.qualifier +Bundle-Version: 4.6.0.qualifier Bundle-ActivationPolicy: lazy -Bundle-RequiredExecutionEnvironment: JavaSE-1.7 +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: org.apache.tools.ant, - org.eclipse.jgit.ant.tasks;version="[4.5.1,4.6.0)", - org.eclipse.jgit.internal.storage.file;version="[4.5.1,4.6.0)", - org.eclipse.jgit.junit;version="[4.5.1,4.6.0)", - org.eclipse.jgit.lib;version="[4.5.1,4.6.0)", - org.eclipse.jgit.util;version="[4.5.1,4.6.0)", + org.eclipse.jgit.ant.tasks;version="[4.6.0,4.7.0)", + org.eclipse.jgit.internal.storage.file;version="[4.6.0,4.7.0)", + org.eclipse.jgit.junit;version="[4.6.0,4.7.0)", + org.eclipse.jgit.lib;version="[4.6.0,4.7.0)", + org.eclipse.jgit.util;version="[4.6.0,4.7.0)", org.hamcrest;version="[1.1.0,2.0.0)", org.junit;version="[4.0.0,5.0.0)"
diff --git a/org.eclipse.jgit.ant.test/build.properties b/org.eclipse.jgit.ant.test/build.properties index e3effea..4a2d892 100644 --- a/org.eclipse.jgit.ant.test/build.properties +++ b/org.eclipse.jgit.ant.test/build.properties
@@ -3,5 +3,5 @@ bin.includes = plugin.properties,\ META-INF/,\ . -jre.compilation.profile = JavaSE-1.7 +jre.compilation.profile = JavaSE-1.8 additional.bundles = org.eclipse.jgit
diff --git a/org.eclipse.jgit.ant.test/pom.xml b/org.eclipse.jgit.ant.test/pom.xml index b375749..6afdfe9 100644 --- a/org.eclipse.jgit.ant.test/pom.xml +++ b/org.eclipse.jgit.ant.test/pom.xml
@@ -50,7 +50,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit-parent</artifactId> - <version>4.5.1-SNAPSHOT</version> + <version>4.6.0-SNAPSHOT</version> </parent> <artifactId>org.eclipse.jgit.ant.test</artifactId>
diff --git a/org.eclipse.jgit.ant/.classpath b/org.eclipse.jgit.ant/.classpath index a14ade4..110168f 100644 --- a/org.eclipse.jgit.ant/.classpath +++ b/org.eclipse.jgit.ant/.classpath
@@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <classpath> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> <classpathentry kind="src" path="src"/> <classpathentry kind="src" path="resources"/>
diff --git a/org.eclipse.jgit.ant/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.ant/.settings/org.eclipse.jdt.core.prefs index cd620c3..80cfbbb 100644 --- a/org.eclipse.jgit.ant/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.jgit.ant/.settings/org.eclipse.jdt.core.prefs
@@ -7,9 +7,9 @@ org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate @@ -112,7 +112,7 @@ org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=error -org.eclipse.jdt.core.compiler.source=1.7 +org.eclipse.jdt.core.compiler.source=1.8 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
diff --git a/org.eclipse.jgit.ant/META-INF/MANIFEST.MF b/org.eclipse.jgit.ant/META-INF/MANIFEST.MF index 88e13b7..26e4cc3 100644 --- a/org.eclipse.jgit.ant/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.ant/META-INF/MANIFEST.MF
@@ -2,11 +2,11 @@ Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name Bundle-SymbolicName: org.eclipse.jgit.ant -Bundle-Version: 4.5.1.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-1.7 +Bundle-Version: 4.6.0.qualifier +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: org.apache.tools.ant, - org.eclipse.jgit.storage.file;version="[4.5.1,4.6.0)" + org.eclipse.jgit.storage.file;version="[4.6.0,4.7.0)" Bundle-Localization: plugin Bundle-Vendor: %Provider-Name -Export-Package: org.eclipse.jgit.ant.tasks;version="4.5.1"; +Export-Package: org.eclipse.jgit.ant.tasks;version="4.6.0"; uses:="org.apache.tools.ant.types,org.apache.tools.ant"
diff --git a/org.eclipse.jgit.ant/pom.xml b/org.eclipse.jgit.ant/pom.xml index ac3e3d1..01f0d42 100644 --- a/org.eclipse.jgit.ant/pom.xml +++ b/org.eclipse.jgit.ant/pom.xml
@@ -48,7 +48,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit-parent</artifactId> - <version>4.5.1-SNAPSHOT</version> + <version>4.6.0-SNAPSHOT</version> </parent> <artifactId>org.eclipse.jgit.ant</artifactId>
diff --git a/org.eclipse.jgit.archive/.classpath b/org.eclipse.jgit.archive/.classpath index 3bc2475..22f3064 100644 --- a/org.eclipse.jgit.archive/.classpath +++ b/org.eclipse.jgit.archive/.classpath
@@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <classpath> <classpathentry kind="src" path="src"/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> <classpathentry kind="output" path="bin"/> </classpath>
diff --git a/org.eclipse.jgit.archive/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.archive/.settings/org.eclipse.jdt.core.prefs index bfaf736..4f1759f 100644 --- a/org.eclipse.jgit.archive/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.jgit.archive/.settings/org.eclipse.jdt.core.prefs
@@ -7,9 +7,9 @@ org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate @@ -112,7 +112,7 @@ org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=error -org.eclipse.jdt.core.compiler.source=1.7 +org.eclipse.jdt.core.compiler.source=1.8 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
diff --git a/org.eclipse.jgit.archive/META-INF/MANIFEST.MF b/org.eclipse.jgit.archive/META-INF/MANIFEST.MF index 1411978..0ae961c 100644 --- a/org.eclipse.jgit.archive/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.archive/META-INF/MANIFEST.MF
@@ -2,24 +2,24 @@ Bundle-ManifestVersion: 2 Bundle-Name: %plugin_name Bundle-SymbolicName: org.eclipse.jgit.archive -Bundle-Version: 4.5.1.qualifier +Bundle-Version: 4.6.0.qualifier Bundle-Vendor: %provider_name Bundle-Localization: plugin -Bundle-RequiredExecutionEnvironment: JavaSE-1.7 +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: org.apache.commons.compress.archivers;version="[1.4,2.0)", org.apache.commons.compress.archivers.tar;version="[1.4,2.0)", org.apache.commons.compress.archivers.zip;version="[1.4,2.0)", org.apache.commons.compress.compressors.bzip2;version="[1.4,2.0)", org.apache.commons.compress.compressors.gzip;version="[1.4,2.0)", org.apache.commons.compress.compressors.xz;version="[1.4,2.0)", - org.eclipse.jgit.api;version="[4.5.1,4.6.0)", - org.eclipse.jgit.lib;version="[4.5.1,4.6.0)", - org.eclipse.jgit.nls;version="[4.5.1,4.6.0)", - org.eclipse.jgit.util;version="[4.5.1,4.6.0)", + org.eclipse.jgit.api;version="[4.6.0,4.7.0)", + org.eclipse.jgit.lib;version="[4.6.0,4.7.0)", + org.eclipse.jgit.nls;version="[4.6.0,4.7.0)", + org.eclipse.jgit.util;version="[4.6.0,4.7.0)", org.osgi.framework;version="[1.3.0,2.0.0)" Bundle-ActivationPolicy: lazy Bundle-Activator: org.eclipse.jgit.archive.FormatActivator -Export-Package: org.eclipse.jgit.archive;version="4.5.1"; +Export-Package: org.eclipse.jgit.archive;version="4.6.0"; uses:="org.eclipse.jgit.lib, org.eclipse.jgit.api, org.apache.commons.compress.archivers,
diff --git a/org.eclipse.jgit.archive/META-INF/SOURCE-MANIFEST.MF b/org.eclipse.jgit.archive/META-INF/SOURCE-MANIFEST.MF index 43ed6c6..a5a6005 100644 --- a/org.eclipse.jgit.archive/META-INF/SOURCE-MANIFEST.MF +++ b/org.eclipse.jgit.archive/META-INF/SOURCE-MANIFEST.MF
@@ -3,5 +3,5 @@ Bundle-Name: org.eclipse.jgit.archive - Sources Bundle-SymbolicName: org.eclipse.jgit.archive.source Bundle-Vendor: Eclipse.org - JGit -Bundle-Version: 4.5.1.qualifier -Eclipse-SourceBundle: org.eclipse.jgit.archive;version="4.5.1.qualifier";roots="." +Bundle-Version: 4.6.0.qualifier +Eclipse-SourceBundle: org.eclipse.jgit.archive;version="4.6.0.qualifier";roots="."
diff --git a/org.eclipse.jgit.archive/pom.xml b/org.eclipse.jgit.archive/pom.xml index 12115df..1d5610f 100644 --- a/org.eclipse.jgit.archive/pom.xml +++ b/org.eclipse.jgit.archive/pom.xml
@@ -50,7 +50,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit-parent</artifactId> - <version>4.5.1-SNAPSHOT</version> + <version>4.6.0-SNAPSHOT</version> </parent> <artifactId>org.eclipse.jgit.archive</artifactId>
diff --git a/org.eclipse.jgit.http.apache/.classpath b/org.eclipse.jgit.http.apache/.classpath index a14ade4..110168f 100644 --- a/org.eclipse.jgit.http.apache/.classpath +++ b/org.eclipse.jgit.http.apache/.classpath
@@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <classpath> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> <classpathentry kind="src" path="src"/> <classpathentry kind="src" path="resources"/>
diff --git a/org.eclipse.jgit.http.apache/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.http.apache/.settings/org.eclipse.jdt.core.prefs index cd620c3..80cfbbb 100644 --- a/org.eclipse.jgit.http.apache/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.jgit.http.apache/.settings/org.eclipse.jdt.core.prefs
@@ -7,9 +7,9 @@ org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate @@ -112,7 +112,7 @@ org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=error -org.eclipse.jdt.core.compiler.source=1.7 +org.eclipse.jdt.core.compiler.source=1.8 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
diff --git a/org.eclipse.jgit.http.apache/META-INF/MANIFEST.MF b/org.eclipse.jgit.http.apache/META-INF/MANIFEST.MF index 48cf4ac..1b4d4b1 100644 --- a/org.eclipse.jgit.http.apache/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.http.apache/META-INF/MANIFEST.MF
@@ -2,30 +2,36 @@ Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name Bundle-SymbolicName: org.eclipse.jgit.http.apache -Bundle-Version: 4.5.1.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-1.7 +Bundle-Version: 4.6.0.qualifier +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-Localization: plugin Bundle-Vendor: %Provider-Name Bundle-ActivationPolicy: lazy -Import-Package: org.apache.http;version="[4.1.0,5.0.0)", - org.apache.http.client;version="[4.1.0,5.0.0)", - org.apache.http.client.methods;version="[4.1.0,5.0.0)", - org.apache.http.client.params;version="[4.1.0,5.0.0)", - org.apache.http.conn;version="[4.1.0,5.0.0)", - org.apache.http.conn.params;version="[4.1.0,5.0.0)", - org.apache.http.conn.scheme;version="[4.1.0,5.0.0)", - org.apache.http.conn.ssl;version="[4.1.0,5.0.0)", - org.apache.http.entity;version="[4.1.0,5.0.0)", - org.apache.http.impl.client;version="[4.1.0,5.0.0)", - org.apache.http.impl.client.cache;version="[4.1.0,5.0.0)", - org.apache.http.params;version="[4.1.0,5.0.0)", - org.eclipse.jgit.nls;version="[4.5.1,4.6.0)", - org.eclipse.jgit.transport.http;version="[4.5.1,4.6.0)", - org.eclipse.jgit.util;version="[4.5.1,4.6.0)" -Export-Package: org.eclipse.jgit.transport.http.apache;version="4.5.1"; - uses:="org.eclipse.jgit.transport.http, - javax.net.ssl, - org.apache.http.client, +Import-Package: org.apache.http;version="[4.3.0,5.0.0)", + org.apache.http.client;version="[4.3.0,5.0.0)", + org.apache.http.client.config;version="[4.3.0,5.0.0)", + org.apache.http.client.methods;version="[4.3.0,5.0.0)", + org.apache.http.client.params;version="[4.3.0,5.0.0)", + org.apache.http.config;version="[4.3.0,5.0.0)", + org.apache.http.conn;version="[4.3.0,5.0.0)", + org.apache.http.conn.params;version="[4.3.0,5.0.0)", + org.apache.http.conn.scheme;version="[4.3.0,5.0.0)", + org.apache.http.conn.socket;version="[4.3.0,5.0.0)", + org.apache.http.conn.ssl;version="[4.3.0,5.0.0)", + org.apache.http.entity;version="[4.3.0,5.0.0)", + org.apache.http.impl.client;version="[4.3.0,5.0.0)", + org.apache.http.impl.client.cache;version="[4.3.0,5.0.0)", + org.apache.http.impl.conn;version="[4.3.0,5.0.0)", + org.apache.http.params;version="[4.3.0,5.0.0)", + org.eclipse.jgit.nls;version="[4.6.0,4.7.0)", + org.eclipse.jgit.transport.http;version="[4.6.0,4.7.0)", + org.eclipse.jgit.util;version="[4.6.0,4.7.0)" +Export-Package: org.eclipse.jgit.transport.http.apache;version="4.6.0"; + uses:="org.apache.http.client, + org.eclipse.jgit.transport.http, + org.apache.http.entity, org.apache.http.client.methods, + javax.net.ssl, + org.eclipse.jgit.util, org.apache.http", org.eclipse.jgit.transport.http.apache.internal;x-internal:=true
diff --git a/org.eclipse.jgit.http.apache/pom.xml b/org.eclipse.jgit.http.apache/pom.xml index 8ad915f..e5c9ab3 100644 --- a/org.eclipse.jgit.http.apache/pom.xml +++ b/org.eclipse.jgit.http.apache/pom.xml
@@ -48,7 +48,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit-parent</artifactId> - <version>4.5.1-SNAPSHOT</version> + <version>4.6.0-SNAPSHOT</version> </parent> <artifactId>org.eclipse.jgit.http.apache</artifactId>
diff --git a/org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/HttpClientConnection.java b/org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/HttpClientConnection.java index 2d9d17a..6543bf6 100644 --- a/org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/HttpClientConnection.java +++ b/org.eclipse.jgit.http.apache/src/org/eclipse/jgit/transport/http/apache/HttpClientConnection.java
@@ -80,19 +80,20 @@ import org.apache.http.HttpResponse; import org.apache.http.client.ClientProtocolException; import org.apache.http.client.HttpClient; +import org.apache.http.client.config.RequestConfig; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpHead; import org.apache.http.client.methods.HttpPost; import org.apache.http.client.methods.HttpPut; import org.apache.http.client.methods.HttpUriRequest; -import org.apache.http.client.params.ClientPNames; -import org.apache.http.conn.params.ConnRoutePNames; -import org.apache.http.conn.scheme.Scheme; -import org.apache.http.conn.ssl.SSLSocketFactory; +import org.apache.http.config.Registry; +import org.apache.http.config.RegistryBuilder; +import org.apache.http.conn.socket.ConnectionSocketFactory; +import org.apache.http.conn.ssl.SSLConnectionSocketFactory; import org.apache.http.conn.ssl.X509HostnameVerifier; -import org.apache.http.impl.client.DefaultHttpClient; -import org.apache.http.params.CoreConnectionPNames; -import org.apache.http.params.HttpParams; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.impl.conn.BasicHttpClientConnectionManager; import org.eclipse.jgit.transport.http.HttpConnection; import org.eclipse.jgit.transport.http.apache.internal.HttpApacheText; import org.eclipse.jgit.util.TemporaryBuffer; @@ -131,29 +132,37 @@ public class HttpClientConnection implements HttpConnection { SSLContext ctx; private HttpClient getClient() { - if (client == null) - client = new DefaultHttpClient(); - HttpParams params = client.getParams(); - if (proxy != null && !Proxy.NO_PROXY.equals(proxy)) { - isUsingProxy = true; - InetSocketAddress adr = (InetSocketAddress) proxy.address(); - params.setParameter(ConnRoutePNames.DEFAULT_PROXY, - new HttpHost(adr.getHostName(), adr.getPort())); - } - if (timeout != null) - params.setIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, - timeout.intValue()); - if (readTimeout != null) - params.setIntParameter(CoreConnectionPNames.SO_TIMEOUT, - readTimeout.intValue()); - if (followRedirects != null) - params.setBooleanParameter(ClientPNames.HANDLE_REDIRECTS, - followRedirects.booleanValue()); - if (hostnameverifier != null) { - SSLSocketFactory sf; - sf = new SSLSocketFactory(getSSLContext(), hostnameverifier); - Scheme https = new Scheme("https", 443, sf); //$NON-NLS-1$ - client.getConnectionManager().getSchemeRegistry().register(https); + if (client == null) { + HttpClientBuilder clientBuilder = HttpClients.custom(); + RequestConfig.Builder configBuilder = RequestConfig.custom(); + if (proxy != null && !Proxy.NO_PROXY.equals(proxy)) { + isUsingProxy = true; + InetSocketAddress adr = (InetSocketAddress) proxy.address(); + clientBuilder.setProxy( + new HttpHost(adr.getHostName(), adr.getPort())); + } + if (timeout != null) { + configBuilder.setConnectTimeout(timeout.intValue()); + } + if (readTimeout != null) { + configBuilder.setSocketTimeout(readTimeout.intValue()); + } + if (followRedirects != null) { + configBuilder + .setRedirectsEnabled(followRedirects.booleanValue()); + } + if (hostnameverifier != null) { + SSLConnectionSocketFactory sslConnectionFactory = new SSLConnectionSocketFactory( + getSSLContext(), hostnameverifier); + clientBuilder.setSSLSocketFactory(sslConnectionFactory); + Registry<ConnectionSocketFactory> registry = RegistryBuilder + .<ConnectionSocketFactory> create() + .register("https", sslConnectionFactory).build(); + clientBuilder.setConnectionManager( + new BasicHttpClientConnectionManager(registry)); + } + clientBuilder.setDefaultRequestConfig(configBuilder.build()); + client = clientBuilder.build(); } return client;
diff --git a/org.eclipse.jgit.http.server/.classpath b/org.eclipse.jgit.http.server/.classpath index 04a2be7..cfcf24a 100644 --- a/org.eclipse.jgit.http.server/.classpath +++ b/org.eclipse.jgit.http.server/.classpath
@@ -2,7 +2,7 @@ <classpath> <classpathentry kind="src" path="src"/> <classpathentry kind="src" path="resources"/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> <classpathentry kind="output" path="bin"/> </classpath>
diff --git a/org.eclipse.jgit.http.server/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.http.server/.settings/org.eclipse.jdt.core.prefs index cd620c3..80cfbbb 100644 --- a/org.eclipse.jgit.http.server/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.jgit.http.server/.settings/org.eclipse.jdt.core.prefs
@@ -7,9 +7,9 @@ org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate @@ -112,7 +112,7 @@ org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=error -org.eclipse.jdt.core.compiler.source=1.7 +org.eclipse.jdt.core.compiler.source=1.8 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
diff --git a/org.eclipse.jgit.http.server/META-INF/MANIFEST.MF b/org.eclipse.jgit.http.server/META-INF/MANIFEST.MF index faad9c1..8351015 100644 --- a/org.eclipse.jgit.http.server/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.http.server/META-INF/MANIFEST.MF
@@ -2,27 +2,27 @@ Bundle-ManifestVersion: 2 Bundle-Name: %plugin_name Bundle-SymbolicName: org.eclipse.jgit.http.server -Bundle-Version: 4.5.1.qualifier +Bundle-Version: 4.6.0.qualifier Bundle-Localization: plugin Bundle-Vendor: %provider_name -Export-Package: org.eclipse.jgit.http.server;version="4.5.1", - org.eclipse.jgit.http.server.glue;version="4.5.1"; +Export-Package: org.eclipse.jgit.http.server;version="4.6.0", + org.eclipse.jgit.http.server.glue;version="4.6.0"; uses:="javax.servlet,javax.servlet.http", - org.eclipse.jgit.http.server.resolver;version="4.5.1"; + org.eclipse.jgit.http.server.resolver;version="4.6.0"; uses:="org.eclipse.jgit.transport.resolver, org.eclipse.jgit.lib, org.eclipse.jgit.transport, javax.servlet.http" Bundle-ActivationPolicy: lazy -Bundle-RequiredExecutionEnvironment: JavaSE-1.7 +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: javax.servlet;version="[2.5.0,3.2.0)", javax.servlet.http;version="[2.5.0,3.2.0)", - org.eclipse.jgit.errors;version="[4.5.1,4.6.0)", - org.eclipse.jgit.internal.storage.dfs;version="[4.5.1,4.6.0)", - org.eclipse.jgit.internal.storage.file;version="[4.5.1,4.6.0)", - org.eclipse.jgit.lib;version="[4.5.1,4.6.0)", - org.eclipse.jgit.nls;version="[4.5.1,4.6.0)", - org.eclipse.jgit.revwalk;version="[4.5.1,4.6.0)", - org.eclipse.jgit.transport;version="[4.5.1,4.6.0)", - org.eclipse.jgit.transport.resolver;version="[4.5.1,4.6.0)", - org.eclipse.jgit.util;version="[4.5.1,4.6.0)" + org.eclipse.jgit.errors;version="[4.6.0,4.7.0)", + org.eclipse.jgit.internal.storage.dfs;version="[4.6.0,4.7.0)", + org.eclipse.jgit.internal.storage.file;version="[4.6.0,4.7.0)", + org.eclipse.jgit.lib;version="[4.6.0,4.7.0)", + org.eclipse.jgit.nls;version="[4.6.0,4.7.0)", + org.eclipse.jgit.revwalk;version="[4.6.0,4.7.0)", + org.eclipse.jgit.transport;version="[4.6.0,4.7.0)", + org.eclipse.jgit.transport.resolver;version="[4.6.0,4.7.0)", + org.eclipse.jgit.util;version="[4.6.0,4.7.0)"
diff --git a/org.eclipse.jgit.http.server/pom.xml b/org.eclipse.jgit.http.server/pom.xml index 264879e..4d08ee9 100644 --- a/org.eclipse.jgit.http.server/pom.xml +++ b/org.eclipse.jgit.http.server/pom.xml
@@ -52,7 +52,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit-parent</artifactId> - <version>4.5.1-SNAPSHOT</version> + <version>4.6.0-SNAPSHOT</version> </parent> <artifactId>org.eclipse.jgit.http.server</artifactId>
diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/WrappedRequest.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/WrappedRequest.java index 7f8da7c..b702c07 100644 --- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/WrappedRequest.java +++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/WrappedRequest.java
@@ -72,7 +72,7 @@ public WrappedRequest(final HttpServletRequest originalRequest, @Override public String getPathTranslated() { final String p = getPathInfo(); - return p != null ? getRealPath(p) : null; + return p != null ? getSession().getServletContext().getRealPath(p) : null; } @Override
diff --git a/org.eclipse.jgit.http.test/.classpath b/org.eclipse.jgit.http.test/.classpath index e1a1a64..e6014c7 100644 --- a/org.eclipse.jgit.http.test/.classpath +++ b/org.eclipse.jgit.http.test/.classpath
@@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <classpath> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> <classpathentry kind="src" path="tst"/> <classpathentry kind="src" path="src"/>
diff --git a/org.eclipse.jgit.http.test/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.http.test/.settings/org.eclipse.jdt.core.prefs index 87210fb..10c29d5 100644 --- a/org.eclipse.jgit.http.test/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.jgit.http.test/.settings/org.eclipse.jdt.core.prefs
@@ -7,9 +7,9 @@ org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate @@ -112,7 +112,7 @@ org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=error -org.eclipse.jdt.core.compiler.source=1.7 +org.eclipse.jdt.core.compiler.source=1.8 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
diff --git a/org.eclipse.jgit.http.test/META-INF/MANIFEST.MF b/org.eclipse.jgit.http.test/META-INF/MANIFEST.MF index 9ea30e4..ad8539f 100644 --- a/org.eclipse.jgit.http.test/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.http.test/META-INF/MANIFEST.MF
@@ -2,10 +2,10 @@ Bundle-ManifestVersion: 2 Bundle-Name: %plugin_name Bundle-SymbolicName: org.eclipse.jgit.http.test -Bundle-Version: 4.5.1.qualifier +Bundle-Version: 4.6.0.qualifier Bundle-Vendor: %provider_name Bundle-Localization: plugin -Bundle-RequiredExecutionEnvironment: JavaSE-1.7 +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: javax.servlet;version="[2.5.0,3.2.0)", javax.servlet.http;version="[2.5.0,3.2.0)", org.eclipse.jetty.continuation;version="[9.0.0,10.0.0)", @@ -22,24 +22,24 @@ org.eclipse.jetty.util.log;version="[9.0.0,10.0.0)", org.eclipse.jetty.util.security;version="[9.0.0,10.0.0)", org.eclipse.jetty.util.thread;version="[9.0.0,10.0.0)", - org.eclipse.jgit.errors;version="[4.5.1,4.6.0)", - org.eclipse.jgit.http.server;version="[4.5.1,4.6.0)", - org.eclipse.jgit.http.server.glue;version="[4.5.1,4.6.0)", - org.eclipse.jgit.http.server.resolver;version="[4.5.1,4.6.0)", - org.eclipse.jgit.internal;version="[4.5.1,4.6.0)", - org.eclipse.jgit.internal.storage.dfs;version="[4.5.1,4.6.0)", - org.eclipse.jgit.internal.storage.file;version="[4.5.1,4.6.0)", - org.eclipse.jgit.junit;version="[4.5.1,4.6.0)", - org.eclipse.jgit.junit.http;version="[4.5.1,4.6.0)", - org.eclipse.jgit.lib;version="[4.5.1,4.6.0)", - org.eclipse.jgit.nls;version="[4.5.1,4.6.0)", - org.eclipse.jgit.revwalk;version="[4.5.1,4.6.0)", - org.eclipse.jgit.storage.file;version="[4.5.1,4.6.0)", - org.eclipse.jgit.transport;version="[4.5.1,4.6.0)", - org.eclipse.jgit.transport.http;version="[4.5.1,4.6.0)", - org.eclipse.jgit.transport.http.apache;version="[4.5.1,4.6.0)", - org.eclipse.jgit.transport.resolver;version="[4.5.1,4.6.0)", - org.eclipse.jgit.util;version="[4.5.1,4.6.0)", + org.eclipse.jgit.errors;version="[4.6.0,4.7.0)", + org.eclipse.jgit.http.server;version="[4.6.0,4.7.0)", + org.eclipse.jgit.http.server.glue;version="[4.6.0,4.7.0)", + org.eclipse.jgit.http.server.resolver;version="[4.6.0,4.7.0)", + org.eclipse.jgit.internal;version="[4.6.0,4.7.0)", + org.eclipse.jgit.internal.storage.dfs;version="[4.6.0,4.7.0)", + org.eclipse.jgit.internal.storage.file;version="[4.6.0,4.7.0)", + org.eclipse.jgit.junit;version="[4.6.0,4.7.0)", + org.eclipse.jgit.junit.http;version="[4.6.0,4.7.0)", + org.eclipse.jgit.lib;version="[4.6.0,4.7.0)", + org.eclipse.jgit.nls;version="[4.6.0,4.7.0)", + org.eclipse.jgit.revwalk;version="[4.6.0,4.7.0)", + org.eclipse.jgit.storage.file;version="[4.6.0,4.7.0)", + org.eclipse.jgit.transport;version="[4.6.0,4.7.0)", + org.eclipse.jgit.transport.http;version="[4.6.0,4.7.0)", + org.eclipse.jgit.transport.http.apache;version="[4.6.0,4.7.0)", + org.eclipse.jgit.transport.resolver;version="[4.6.0,4.7.0)", + org.eclipse.jgit.util;version="[4.6.0,4.7.0)", org.hamcrest.core;version="[1.1.0,2.0.0)", org.junit;version="[4.0.0,5.0.0)", org.junit.runner;version="[4.0.0,5.0.0)",
diff --git a/org.eclipse.jgit.http.test/pom.xml b/org.eclipse.jgit.http.test/pom.xml index a64ce07..4c1be08 100644 --- a/org.eclipse.jgit.http.test/pom.xml +++ b/org.eclipse.jgit.http.test/pom.xml
@@ -51,7 +51,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit-parent</artifactId> - <version>4.5.1-SNAPSHOT</version> + <version>4.6.0-SNAPSHOT</version> </parent> <artifactId>org.eclipse.jgit.http.test</artifactId>
diff --git a/org.eclipse.jgit.junit.http/.classpath b/org.eclipse.jgit.junit.http/.classpath index b1dabee..b862a29 100644 --- a/org.eclipse.jgit.junit.http/.classpath +++ b/org.eclipse.jgit.junit.http/.classpath
@@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <classpath> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> <classpathentry kind="src" path="src"/> <classpathentry kind="output" path="bin"/>
diff --git a/org.eclipse.jgit.junit.http/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.junit.http/.settings/org.eclipse.jdt.core.prefs index 87210fb..10c29d5 100644 --- a/org.eclipse.jgit.junit.http/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.jgit.junit.http/.settings/org.eclipse.jdt.core.prefs
@@ -7,9 +7,9 @@ org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate @@ -112,7 +112,7 @@ org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=error -org.eclipse.jdt.core.compiler.source=1.7 +org.eclipse.jdt.core.compiler.source=1.8 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
diff --git a/org.eclipse.jgit.junit.http/META-INF/MANIFEST.MF b/org.eclipse.jgit.junit.http/META-INF/MANIFEST.MF index 27793a0..2d68344 100644 --- a/org.eclipse.jgit.junit.http/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.junit.http/META-INF/MANIFEST.MF
@@ -2,11 +2,11 @@ Bundle-ManifestVersion: 2 Bundle-Name: %plugin_name Bundle-SymbolicName: org.eclipse.jgit.junit.http -Bundle-Version: 4.5.1.qualifier +Bundle-Version: 4.6.0.qualifier Bundle-Localization: plugin Bundle-Vendor: %provider_name Bundle-ActivationPolicy: lazy -Bundle-RequiredExecutionEnvironment: JavaSE-1.7 +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: javax.servlet;version="[2.5.0,3.2.0)", javax.servlet.http;version="[2.5.0,3.2.0)", org.apache.commons.logging;version="[1.1.1,2.0.0)", @@ -20,16 +20,16 @@ org.eclipse.jetty.util.component;version="[9.0.0,10.0.0)", org.eclipse.jetty.util.log;version="[9.0.0,10.0.0)", org.eclipse.jetty.util.security;version="[9.0.0,10.0.0)", - org.eclipse.jgit.errors;version="[4.5.1,4.6.0)", - org.eclipse.jgit.http.server;version="[4.5.1,4.6.0)", - org.eclipse.jgit.internal.storage.file;version="[4.5.1,4.6.0)", - org.eclipse.jgit.junit;version="[4.5.1,4.6.0)", - org.eclipse.jgit.lib;version="[4.5.1,4.6.0)", - org.eclipse.jgit.revwalk;version="[4.5.1,4.6.0)", - org.eclipse.jgit.transport;version="[4.5.1,4.6.0)", - org.eclipse.jgit.transport.resolver;version="[4.5.1,4.6.0)", + org.eclipse.jgit.errors;version="[4.6.0,4.7.0)", + org.eclipse.jgit.http.server;version="[4.6.0,4.7.0)", + org.eclipse.jgit.internal.storage.file;version="[4.6.0,4.7.0)", + org.eclipse.jgit.junit;version="[4.6.0,4.7.0)", + org.eclipse.jgit.lib;version="[4.6.0,4.7.0)", + org.eclipse.jgit.revwalk;version="[4.6.0,4.7.0)", + org.eclipse.jgit.transport;version="[4.6.0,4.7.0)", + org.eclipse.jgit.transport.resolver;version="[4.6.0,4.7.0)", org.junit;version="[4.0.0,5.0.0)" -Export-Package: org.eclipse.jgit.junit.http;version="4.5.1"; +Export-Package: org.eclipse.jgit.junit.http;version="4.6.0"; uses:="org.eclipse.jgit.transport, org.eclipse.jgit.junit, javax.servlet.http,
diff --git a/org.eclipse.jgit.junit.http/pom.xml b/org.eclipse.jgit.junit.http/pom.xml index bbe166d..79172a1 100644 --- a/org.eclipse.jgit.junit.http/pom.xml +++ b/org.eclipse.jgit.junit.http/pom.xml
@@ -50,7 +50,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit-parent</artifactId> - <version>4.5.1-SNAPSHOT</version> + <version>4.6.0-SNAPSHOT</version> </parent> <artifactId>org.eclipse.jgit.junit.http</artifactId>
diff --git a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AppServer.java b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AppServer.java index cca4f43..44c1977 100644 --- a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AppServer.java +++ b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/AppServer.java
@@ -185,13 +185,11 @@ protected void loadUsers() throws IOException { putUser(username, new Password(password), new String[] { role }); } - protected String[] loadRoleInfo( - @SuppressWarnings("unused") KnownUser user) { + protected String[] loadRoleInfo(KnownUser user) { return null; } - protected KnownUser loadUserInfo( - @SuppressWarnings("unused") String usrname) { + protected KnownUser loadUserInfo(String usrname) { return null; } }
diff --git a/org.eclipse.jgit.junit/.classpath b/org.eclipse.jgit.junit/.classpath index 098194c..eca7bdb 100644 --- a/org.eclipse.jgit.junit/.classpath +++ b/org.eclipse.jgit.junit/.classpath
@@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <classpath> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> <classpathentry kind="src" path="src"/> <classpathentry kind="output" path="bin"/>
diff --git a/org.eclipse.jgit.junit/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.junit/.settings/org.eclipse.jdt.core.prefs index 87210fb..10c29d5 100644 --- a/org.eclipse.jgit.junit/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.jgit.junit/.settings/org.eclipse.jdt.core.prefs
@@ -7,9 +7,9 @@ org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate @@ -112,7 +112,7 @@ org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=error -org.eclipse.jdt.core.compiler.source=1.7 +org.eclipse.jdt.core.compiler.source=1.8 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
diff --git a/org.eclipse.jgit.junit/META-INF/MANIFEST.MF b/org.eclipse.jgit.junit/META-INF/MANIFEST.MF index f8c20b4..d7ce175 100644 --- a/org.eclipse.jgit.junit/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.junit/META-INF/MANIFEST.MF
@@ -2,30 +2,30 @@ Bundle-ManifestVersion: 2 Bundle-Name: %plugin_name Bundle-SymbolicName: org.eclipse.jgit.junit -Bundle-Version: 4.5.1.qualifier +Bundle-Version: 4.6.0.qualifier Bundle-Localization: plugin Bundle-Vendor: %provider_name Bundle-ActivationPolicy: lazy -Bundle-RequiredExecutionEnvironment: JavaSE-1.7 -Import-Package: org.eclipse.jgit.api;version="[4.5.1,4.6.0)", - org.eclipse.jgit.api.errors;version="[4.5.1,4.6.0)", - org.eclipse.jgit.dircache;version="[4.5.1,4.6.0)", - org.eclipse.jgit.errors;version="[4.5.1,4.6.0)", - org.eclipse.jgit.internal.storage.file;version="[4.5.1,4.6.0)", - org.eclipse.jgit.internal.storage.pack;version="[4.5.1,4.6.0)", - org.eclipse.jgit.lib;version="[4.5.1,4.6.0)", - org.eclipse.jgit.merge;version="[4.5.1,4.6.0)", - org.eclipse.jgit.revwalk;version="[4.5.1,4.6.0)", - org.eclipse.jgit.storage.file;version="[4.5.1,4.6.0)", - org.eclipse.jgit.treewalk;version="[4.5.1,4.6.0)", - org.eclipse.jgit.treewalk.filter;version="[4.5.1,4.6.0)", - org.eclipse.jgit.util;version="[4.5.1,4.6.0)", - org.eclipse.jgit.util.io;version="[4.5.1,4.6.0)", +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Import-Package: org.eclipse.jgit.api;version="[4.6.0,4.7.0)", + org.eclipse.jgit.api.errors;version="[4.6.0,4.7.0)", + org.eclipse.jgit.dircache;version="[4.6.0,4.7.0)", + org.eclipse.jgit.errors;version="[4.6.0,4.7.0)", + org.eclipse.jgit.internal.storage.file;version="[4.6.0,4.7.0)", + org.eclipse.jgit.internal.storage.pack;version="[4.6.0,4.7.0)", + org.eclipse.jgit.lib;version="[4.6.0,4.7.0)", + org.eclipse.jgit.merge;version="[4.6.0,4.7.0)", + org.eclipse.jgit.revwalk;version="[4.6.0,4.7.0)", + org.eclipse.jgit.storage.file;version="[4.6.0,4.7.0)", + org.eclipse.jgit.treewalk;version="[4.6.0,4.7.0)", + org.eclipse.jgit.treewalk.filter;version="[4.6.0,4.7.0)", + org.eclipse.jgit.util;version="[4.6.0,4.7.0)", + org.eclipse.jgit.util.io;version="[4.6.0,4.7.0)", org.junit;version="[4.0.0,5.0.0)", org.junit.rules;version="[4.9.0,5.0.0)", org.junit.runner;version="[4.0.0,5.0.0)", org.junit.runners.model;version="[4.5.0,5.0.0)" -Export-Package: org.eclipse.jgit.junit;version="4.5.1"; +Export-Package: org.eclipse.jgit.junit;version="4.6.0"; uses:="org.eclipse.jgit.dircache, org.eclipse.jgit.lib, org.eclipse.jgit.revwalk,
diff --git a/org.eclipse.jgit.junit/pom.xml b/org.eclipse.jgit.junit/pom.xml index b812fdc..fbe56fc 100644 --- a/org.eclipse.jgit.junit/pom.xml +++ b/org.eclipse.jgit.junit/pom.xml
@@ -52,7 +52,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit-parent</artifactId> - <version>4.5.1-SNAPSHOT</version> + <version>4.6.0-SNAPSHOT</version> </parent> <artifactId>org.eclipse.jgit.junit</artifactId>
diff --git a/org.eclipse.jgit.lfs.server.test/.classpath b/org.eclipse.jgit.lfs.server.test/.classpath index 2fdcc94..4f9f6bf 100644 --- a/org.eclipse.jgit.lfs.server.test/.classpath +++ b/org.eclipse.jgit.lfs.server.test/.classpath
@@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <classpath> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> <classpathentry kind="src" path="tst"/> <classpathentry kind="output" path="bin"/>
diff --git a/org.eclipse.jgit.lfs.server.test/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.lfs.server.test/.settings/org.eclipse.jdt.core.prefs index 87210fb..10c29d5 100644 --- a/org.eclipse.jgit.lfs.server.test/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.jgit.lfs.server.test/.settings/org.eclipse.jdt.core.prefs
@@ -7,9 +7,9 @@ org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate @@ -112,7 +112,7 @@ org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=error -org.eclipse.jdt.core.compiler.source=1.7 +org.eclipse.jdt.core.compiler.source=1.8 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
diff --git a/org.eclipse.jgit.lfs.server.test/META-INF/MANIFEST.MF b/org.eclipse.jgit.lfs.server.test/META-INF/MANIFEST.MF index 63000b0..49a1120 100644 --- a/org.eclipse.jgit.lfs.server.test/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.lfs.server.test/META-INF/MANIFEST.MF
@@ -2,10 +2,10 @@ Bundle-ManifestVersion: 2 Bundle-Name: %plugin_name Bundle-SymbolicName: org.eclipse.jgit.lfs.server.test -Bundle-Version: 4.5.1.qualifier +Bundle-Version: 4.6.0.qualifier Bundle-Vendor: %provider_name Bundle-Localization: plugin -Bundle-RequiredExecutionEnvironment: JavaSE-1.7 +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: javax.servlet;version="[3.1.0,4.0.0)", javax.servlet.http;version="[3.1.0,4.0.0)", org.apache.http;version="[4.3.0,5.0.0)", @@ -27,11 +27,11 @@ org.eclipse.jetty.util.log;version="[9.0.0,10.0.0)", org.eclipse.jetty.util.security;version="[9.0.0,10.0.0)", org.eclipse.jetty.util.thread;version="[9.0.0,10.0.0)", - org.eclipse.jgit.junit.http;version="[4.5.1,4.6.0)", - org.eclipse.jgit.lfs.lib;version="[4.5.1,4.6.0)", - org.eclipse.jgit.lfs.server.fs;version="[4.5.1,4.6.0)", - org.eclipse.jgit.lfs.test;version="[4.5.1,4.6.0)", - org.eclipse.jgit.util;version="[4.5.1,4.6.0)", + org.eclipse.jgit.junit.http;version="[4.6.0,4.7.0)", + org.eclipse.jgit.lfs.lib;version="[4.6.0,4.7.0)", + org.eclipse.jgit.lfs.server.fs;version="[4.6.0,4.7.0)", + org.eclipse.jgit.lfs.test;version="[4.6.0,4.7.0)", + org.eclipse.jgit.util;version="[4.6.0,4.7.0)", org.hamcrest.core;version="[1.1.0,2.0.0)", org.junit;version="[4.0.0,5.0.0)", org.junit.runner;version="[4.0.0,5.0.0)",
diff --git a/org.eclipse.jgit.lfs.server.test/pom.xml b/org.eclipse.jgit.lfs.server.test/pom.xml index 5189c77..61e1239 100644 --- a/org.eclipse.jgit.lfs.server.test/pom.xml +++ b/org.eclipse.jgit.lfs.server.test/pom.xml
@@ -50,7 +50,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit-parent</artifactId> - <version>4.5.1-SNAPSHOT</version> + <version>4.6.0-SNAPSHOT</version> </parent> <artifactId>org.eclipse.jgit.lfs.server.test</artifactId>
diff --git a/org.eclipse.jgit.lfs.server.test/tst/org/eclipse/jgit/lfs/server/fs/LfsServerTest.java b/org.eclipse.jgit.lfs.server.test/tst/org/eclipse/jgit/lfs/server/fs/LfsServerTest.java index 4d948b9..e10660d 100644 --- a/org.eclipse.jgit.lfs.server.test/tst/org/eclipse/jgit/lfs/server/fs/LfsServerTest.java +++ b/org.eclipse.jgit.lfs.server.test/tst/org/eclipse/jgit/lfs/server/fs/LfsServerTest.java
@@ -84,7 +84,6 @@ import org.junit.After; import org.junit.Before; -@SuppressWarnings("restriction") public abstract class LfsServerTest { private static final long timeout = /* 10 sec */ 10 * 1000;
diff --git a/org.eclipse.jgit.lfs.server/.classpath b/org.eclipse.jgit.lfs.server/.classpath index 04a2be7..cfcf24a 100644 --- a/org.eclipse.jgit.lfs.server/.classpath +++ b/org.eclipse.jgit.lfs.server/.classpath
@@ -2,7 +2,7 @@ <classpath> <classpathentry kind="src" path="src"/> <classpathentry kind="src" path="resources"/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> <classpathentry kind="output" path="bin"/> </classpath>
diff --git a/org.eclipse.jgit.lfs.server/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.lfs.server/.settings/org.eclipse.jdt.core.prefs index 1ce7cd0..808ec3a 100644 --- a/org.eclipse.jgit.lfs.server/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.jgit.lfs.server/.settings/org.eclipse.jdt.core.prefs
@@ -7,9 +7,9 @@ org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate @@ -112,7 +112,7 @@ org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=error -org.eclipse.jdt.core.compiler.source=1.7 +org.eclipse.jdt.core.compiler.source=1.8 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
diff --git a/org.eclipse.jgit.lfs.server/META-INF/MANIFEST.MF b/org.eclipse.jgit.lfs.server/META-INF/MANIFEST.MF index 5ff701d..459118f 100644 --- a/org.eclipse.jgit.lfs.server/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.lfs.server/META-INF/MANIFEST.MF
@@ -2,34 +2,35 @@ Bundle-ManifestVersion: 2 Bundle-Name: %plugin_name Bundle-SymbolicName: org.eclipse.jgit.lfs.server -Bundle-Version: 4.5.1.qualifier +Bundle-Version: 4.6.0.qualifier Bundle-Localization: plugin Bundle-Vendor: %provider_name -Export-Package: org.eclipse.jgit.lfs.server;version="4.5.1"; +Export-Package: org.eclipse.jgit.lfs.server;version="4.6.0"; uses:="javax.servlet.http, org.eclipse.jgit.lfs.lib", - org.eclipse.jgit.lfs.server.fs;version="4.5.1"; + org.eclipse.jgit.lfs.server.fs;version="4.6.0"; uses:="javax.servlet, javax.servlet.http, org.eclipse.jgit.lfs.server, org.eclipse.jgit.lfs.lib", - org.eclipse.jgit.lfs.server.internal;version="4.5.1";x-internal:=true, - org.eclipse.jgit.lfs.server.s3;version="4.5.1"; + org.eclipse.jgit.lfs.server.internal;version="4.6.0";x-internal:=true, + org.eclipse.jgit.lfs.server.s3;version="4.6.0"; uses:="org.eclipse.jgit.lfs.server, org.eclipse.jgit.lfs.lib" -Bundle-RequiredExecutionEnvironment: JavaSE-1.7 +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: com.google.gson;version="[2.2.4,3.0.0)", javax.servlet;version="[3.1.0,4.0.0)", javax.servlet.annotation;version="[3.1.0,4.0.0)", javax.servlet.http;version="[3.1.0,4.0.0)", org.apache.http;version="[4.3.0,5.0.0)", org.apache.http.client;version="[4.3.0,5.0.0)", - org.eclipse.jgit.annotations;version="[4.5.1,4.6.0)", - org.eclipse.jgit.internal;version="[4.5.1,4.6.0)", - org.eclipse.jgit.internal.storage.file;version="[4.5.1,4.6.0)", - org.eclipse.jgit.lfs.errors;version="[4.5.1,4.6.0)", - org.eclipse.jgit.lfs.lib;version="[4.5.1,4.6.0)", - org.eclipse.jgit.nls;version="[4.5.1,4.6.0)", - org.eclipse.jgit.transport.http;version="[4.5.1,4.6.0)", - org.eclipse.jgit.transport.http.apache;version="[4.5.1,4.6.0)", - org.eclipse.jgit.util;version="[4.5.1,4.6.0)" + org.eclipse.jgit.annotations;version="[4.6.0,4.7.0)", + org.eclipse.jgit.internal;version="[4.6.0,4.7.0)", + org.eclipse.jgit.internal.storage.file;version="[4.6.0,4.7.0)", + org.eclipse.jgit.lfs.errors;version="[4.6.0,4.7.0)", + org.eclipse.jgit.lfs.internal;version="[4.6.0,4.7.0)", + org.eclipse.jgit.lfs.lib;version="[4.6.0,4.7.0)", + org.eclipse.jgit.nls;version="[4.6.0,4.7.0)", + org.eclipse.jgit.transport.http;version="[4.6.0,4.7.0)", + org.eclipse.jgit.transport.http.apache;version="[4.6.0,4.7.0)", + org.eclipse.jgit.util;version="[4.6.0,4.7.0)"
diff --git a/org.eclipse.jgit.lfs.server/pom.xml b/org.eclipse.jgit.lfs.server/pom.xml index e743532..55b863b 100644 --- a/org.eclipse.jgit.lfs.server/pom.xml +++ b/org.eclipse.jgit.lfs.server/pom.xml
@@ -50,7 +50,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit-parent</artifactId> - <version>4.5.1-SNAPSHOT</version> + <version>4.6.0-SNAPSHOT</version> </parent> <artifactId>org.eclipse.jgit.lfs.server</artifactId>
diff --git a/org.eclipse.jgit.lfs.server/resources/org/eclipse/jgit/lfs/server/internal/LfsServerText.properties b/org.eclipse.jgit.lfs.server/resources/org/eclipse/jgit/lfs/server/internal/LfsServerText.properties index f97acac..b2b487e 100644 --- a/org.eclipse.jgit.lfs.server/resources/org/eclipse/jgit/lfs/server/internal/LfsServerText.properties +++ b/org.eclipse.jgit.lfs.server/resources/org/eclipse/jgit/lfs/server/internal/LfsServerText.properties
@@ -1,4 +1,3 @@ -corruptLongObject=The content hash ''{0}'' of the long object ''{1}'' doesn''t match its id, the corrupt object will be deleted. failedToCalcSignature=Failed to calculate a request signature: {0} invalidPathInfo=Invalid pathInfo ''{0}'' does not match ''/'{'SHA-256'}''' objectNotFound=Object ''{0}'' not found
diff --git a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/FileLfsRepository.java b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/FileLfsRepository.java index dd70a36..a05fa01 100644 --- a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/FileLfsRepository.java +++ b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/FileLfsRepository.java
@@ -53,6 +53,7 @@ import java.util.Collections; import org.eclipse.jgit.annotations.Nullable; +import org.eclipse.jgit.lfs.internal.AtomicObjectOutputStream; import org.eclipse.jgit.lfs.lib.AnyLongObjectId; import org.eclipse.jgit.lfs.lib.Constants; import org.eclipse.jgit.lfs.server.LargeFileRepository;
diff --git a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/ObjectUploadListener.java b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/ObjectUploadListener.java index d44b3db..bb31743 100644 --- a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/ObjectUploadListener.java +++ b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/ObjectUploadListener.java
@@ -59,6 +59,7 @@ import org.apache.http.HttpStatus; import org.eclipse.jgit.lfs.errors.CorruptLongObjectException; +import org.eclipse.jgit.lfs.internal.AtomicObjectOutputStream; import org.eclipse.jgit.lfs.lib.AnyLongObjectId; import org.eclipse.jgit.lfs.lib.Constants;
diff --git a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/internal/LfsServerText.java b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/internal/LfsServerText.java index c5ad53a..2e088fd 100644 --- a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/internal/LfsServerText.java +++ b/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/internal/LfsServerText.java
@@ -58,7 +58,6 @@ public static LfsServerText get() { } // @formatter:off - /***/ public String corruptLongObject; /***/ public String failedToCalcSignature; /***/ public String invalidPathInfo; /***/ public String objectNotFound;
diff --git a/org.eclipse.jgit.lfs.test/.classpath b/org.eclipse.jgit.lfs.test/.classpath index efc781d..e43ae76 100644 --- a/org.eclipse.jgit.lfs.test/.classpath +++ b/org.eclipse.jgit.lfs.test/.classpath
@@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <classpath> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> <classpathentry kind="src" path="src"/> <classpathentry kind="src" path="tst"/>
diff --git a/org.eclipse.jgit.lfs.test/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.lfs.test/.settings/org.eclipse.jdt.core.prefs index 87210fb..10c29d5 100644 --- a/org.eclipse.jgit.lfs.test/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.jgit.lfs.test/.settings/org.eclipse.jdt.core.prefs
@@ -7,9 +7,9 @@ org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate @@ -112,7 +112,7 @@ org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=error -org.eclipse.jdt.core.compiler.source=1.7 +org.eclipse.jdt.core.compiler.source=1.8 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
diff --git a/org.eclipse.jgit.lfs.test/META-INF/MANIFEST.MF b/org.eclipse.jgit.lfs.test/META-INF/MANIFEST.MF index 430db2b..02bc685 100644 --- a/org.eclipse.jgit.lfs.test/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.lfs.test/META-INF/MANIFEST.MF
@@ -2,18 +2,18 @@ Bundle-ManifestVersion: 2 Bundle-Name: %plugin_name Bundle-SymbolicName: org.eclipse.jgit.lfs.test -Bundle-Version: 4.5.1.qualifier +Bundle-Version: 4.6.0.qualifier Bundle-Vendor: %provider_name Bundle-Localization: plugin -Bundle-RequiredExecutionEnvironment: JavaSE-1.7 -Import-Package: org.eclipse.jgit.junit;version="[4.5.1,4.6.0)", - org.eclipse.jgit.lfs.errors;version="[4.5.1,4.6.0)", - org.eclipse.jgit.lfs.lib;version="[4.5.1,4.6.0)", - org.eclipse.jgit.lib;version="[4.5.1,4.6.0)", - org.eclipse.jgit.util;version="[4.5.1,4.6.0)", +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Import-Package: org.eclipse.jgit.junit;version="[4.6.0,4.7.0)", + org.eclipse.jgit.lfs.errors;version="[4.6.0,4.7.0)", + org.eclipse.jgit.lfs.lib;version="[4.6.0,4.7.0)", + org.eclipse.jgit.lib;version="[4.6.0,4.7.0)", + org.eclipse.jgit.util;version="[4.6.0,4.7.0)", org.hamcrest.core;version="[1.1.0,2.0.0)", org.junit;version="[4.0.0,5.0.0)", org.junit.runner;version="[4.0.0,5.0.0)", org.junit.runners;version="[4.0.0,5.0.0)" -Export-Package: org.eclipse.jgit.lfs.test;version="4.5.1";x-friends:="org.eclipse.jgit.lfs.server.test" +Export-Package: org.eclipse.jgit.lfs.test;version="4.6.0";x-friends:="org.eclipse.jgit.lfs.server.test"
diff --git a/org.eclipse.jgit.lfs.test/pom.xml b/org.eclipse.jgit.lfs.test/pom.xml index 2c77ddb..b3dc7d6 100644 --- a/org.eclipse.jgit.lfs.test/pom.xml +++ b/org.eclipse.jgit.lfs.test/pom.xml
@@ -50,7 +50,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit-parent</artifactId> - <version>4.5.1-SNAPSHOT</version> + <version>4.6.0-SNAPSHOT</version> </parent> <artifactId>org.eclipse.jgit.lfs.test</artifactId>
diff --git a/org.eclipse.jgit.lfs/.classpath b/org.eclipse.jgit.lfs/.classpath index 04a2be7..cfcf24a 100644 --- a/org.eclipse.jgit.lfs/.classpath +++ b/org.eclipse.jgit.lfs/.classpath
@@ -2,7 +2,7 @@ <classpath> <classpathentry kind="src" path="src"/> <classpathentry kind="src" path="resources"/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> <classpathentry kind="output" path="bin"/> </classpath>
diff --git a/org.eclipse.jgit.lfs/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.lfs/.settings/org.eclipse.jdt.core.prefs index 1ce7cd0..808ec3a 100644 --- a/org.eclipse.jgit.lfs/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.jgit.lfs/.settings/org.eclipse.jdt.core.prefs
@@ -7,9 +7,9 @@ org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate @@ -112,7 +112,7 @@ org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=error -org.eclipse.jdt.core.compiler.source=1.7 +org.eclipse.jdt.core.compiler.source=1.8 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
diff --git a/org.eclipse.jgit.lfs/META-INF/MANIFEST.MF b/org.eclipse.jgit.lfs/META-INF/MANIFEST.MF index 03e7bc7..8252603 100644 --- a/org.eclipse.jgit.lfs/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.lfs/META-INF/MANIFEST.MF
@@ -2,14 +2,17 @@ Bundle-ManifestVersion: 2 Bundle-Name: %plugin_name Bundle-SymbolicName: org.eclipse.jgit.lfs -Bundle-Version: 4.5.1.qualifier +Bundle-Version: 4.6.0.qualifier Bundle-Localization: plugin Bundle-Vendor: %provider_name -Export-Package: org.eclipse.jgit.lfs.errors;version="4.5.1", - org.eclipse.jgit.lfs.internal;version="4.5.1";x-friends:="org.eclipse.jgit.lfs.test", - org.eclipse.jgit.lfs.lib;version="4.5.1" -Bundle-RequiredExecutionEnvironment: JavaSE-1.7 -Import-Package: org.eclipse.jgit.internal.storage.file;version="[4.5.1,4.6.0)", - org.eclipse.jgit.lib;version="[4.5.1,4.6.0)", - org.eclipse.jgit.nls;version="[4.5.1,4.6.0)", - org.eclipse.jgit.util;version="[4.5.1,4.6.0)" +Export-Package: org.eclipse.jgit.lfs;version="4.6.0", + org.eclipse.jgit.lfs.errors;version="4.6.0", + org.eclipse.jgit.lfs.internal;version="4.6.0";x-friends:="org.eclipse.jgit.lfs.test,org.eclipse.jgit.lfs.server.fs,org.eclipse.jgit.lfs.server", + org.eclipse.jgit.lfs.lib;version="4.6.0" +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Import-Package: org.eclipse.jgit.annotations;version="[4.6.0,4.7.0)";resolution:=optional, + org.eclipse.jgit.attributes;version="[4.6.0,4.7.0)", + org.eclipse.jgit.internal.storage.file;version="[4.6.0,4.7.0)", + org.eclipse.jgit.lib;version="[4.6.0,4.7.0)", + org.eclipse.jgit.nls;version="[4.6.0,4.7.0)", + org.eclipse.jgit.util;version="[4.6.0,4.7.0)"
diff --git a/org.eclipse.jgit.lfs/pom.xml b/org.eclipse.jgit.lfs/pom.xml index 2d3bb62..6e0c461 100644 --- a/org.eclipse.jgit.lfs/pom.xml +++ b/org.eclipse.jgit.lfs/pom.xml
@@ -50,7 +50,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit-parent</artifactId> - <version>4.5.1-SNAPSHOT</version> + <version>4.6.0-SNAPSHOT</version> </parent> <artifactId>org.eclipse.jgit.lfs</artifactId>
diff --git a/org.eclipse.jgit.lfs/resources/org/eclipse/jgit/lfs/internal/LfsText.properties b/org.eclipse.jgit.lfs/resources/org/eclipse/jgit/lfs/internal/LfsText.properties index 7c3aea2..5e52a78 100644 --- a/org.eclipse.jgit.lfs/resources/org/eclipse/jgit/lfs/internal/LfsText.properties +++ b/org.eclipse.jgit.lfs/resources/org/eclipse/jgit/lfs/internal/LfsText.properties
@@ -1,7 +1,9 @@ +corruptLongObject=The content hash ''{0}'' of the long object ''{1}'' doesn''t match its id, the corrupt object will be deleted. incorrectLONG_OBJECT_ID_LENGTH=Incorrect LONG_OBJECT_ID_LENGTH. +inconsistentMediafileLength=mediafile {0} has unexpected length; expected {1} but found {2}. invalidLongId=Invalid id: {0} invalidLongIdLength=Invalid id length {0}; should be {1} requiredHashFunctionNotAvailable=Required hash function {0} not available. repositoryNotFound=Repository {0} not found repositoryReadOnly=Repository {0} is read-only -lfsUnavailable=LFS is not available for repository {0} \ No newline at end of file +lfsUnavailable=LFS is not available for repository {0}
diff --git a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/CleanFilter.java b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/CleanFilter.java new file mode 100644 index 0000000..f7b55e5 --- /dev/null +++ b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/CleanFilter.java
@@ -0,0 +1,176 @@ +/* + * Copyright (C) 2016, Christian Halstrick <christian.halstrick@sap.com> + * and other copyright owners as documented in the project's IP log. + * + * This program and the accompanying materials are made available + * under the terms of the Eclipse Distribution License v1.0 which + * accompanies this distribution, is reproduced below, and is + * available at http://www.eclipse.org/org/documents/edl-v10.php + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * + * - Neither the name of the Eclipse Foundation, Inc. nor the + * names of its contributors may be used to endorse or promote + * products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.eclipse.jgit.lfs; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardOpenOption; +import java.security.DigestOutputStream; + +import org.eclipse.jgit.attributes.FilterCommand; +import org.eclipse.jgit.attributes.FilterCommandFactory; +import org.eclipse.jgit.attributes.FilterCommandRegistry; +import org.eclipse.jgit.lfs.errors.CorruptMediaFile; +import org.eclipse.jgit.lfs.lib.Constants; +import org.eclipse.jgit.lfs.lib.LongObjectId; +import org.eclipse.jgit.lib.Repository; +import org.eclipse.jgit.util.FileUtils; + +/** + * Built-in LFS clean filter + * + * When new content is about to be added to the git repository and this filter + * is configured for that content, then this filter will replace the original + * content with content of a so-called LFS pointer file. The pointer file + * content will then be added to the git repository. Additionally this filter + * writes the original content in a so-called 'media file' to '.git/lfs/objects/ + * <first-two-characters-of-contentid>/<rest-of-contentid>' + * + * @see <a href="https://github.com/github/git-lfs/blob/master/docs/spec.md">Git + * LFS Specification</a> + * @since 4.6 + */ +public class CleanFilter extends FilterCommand { + /** + * The factory is responsible for creating instances of {@link CleanFilter} + */ + public final static FilterCommandFactory FACTORY = new FilterCommandFactory() { + + @Override + public FilterCommand create(Repository db, InputStream in, + OutputStream out) throws IOException { + return new CleanFilter(db, in, out); + } + }; + + /** + * Registers this filter by calling + * {@link FilterCommandRegistry#register(String, FilterCommandFactory)} + */ + public final static void register() { + FilterCommandRegistry.register( + org.eclipse.jgit.lib.Constants.BUILTIN_FILTER_PREFIX + + "lfs/clean", //$NON-NLS-1$ + FACTORY); + } + + // The OutputStream to a temporary file which will be renamed to mediafile + // when the operation succeeds + private OutputStream tmpOut; + + // Used to compute the hash for the original content + private DigestOutputStream dOut; + + private Lfs lfsUtil; + + // the size of the original content + private long size; + + // a temporary file into which the original content is written. When no + // errors occur this file will be renamed to the mediafile + private Path tmpFile; + + /** + * @param db + * the repository + * @param in + * an {@link InputStream} providing the original content + * @param out + * the {@link OutputStream} into which the content of the pointer + * file should be written. That's the content which will be added + * to the git repository + * @throws IOException + * when the creation of the temporary file fails or when no + * {@link OutputStream} for this file can be created + */ + public CleanFilter(Repository db, InputStream in, OutputStream out) + throws IOException { + super(in, out); + lfsUtil = new Lfs(db.getDirectory().toPath().resolve("lfs")); //$NON-NLS-1$ + Files.createDirectories(lfsUtil.getLfsTmpDir()); + tmpFile = lfsUtil.createTmpFile(); + tmpOut = Files.newOutputStream(tmpFile, + StandardOpenOption.CREATE); + this.dOut = new DigestOutputStream( + tmpOut, + Constants.newMessageDigest()); + } + + public int run() throws IOException { + try { + int b = in.read(); + if (b != -1) { + dOut.write(b); + size++; + return 1; + } else { + dOut.close(); + tmpOut.close(); + LongObjectId loid = LongObjectId + .fromRaw(dOut.getMessageDigest().digest()); + Path mediaFile = lfsUtil.getMediaFile(loid); + if (Files.isRegularFile(mediaFile)) { + long fsSize = Files.size(mediaFile); + if (fsSize != size) { + throw new CorruptMediaFile(mediaFile, size, fsSize); + } + } else { + FileUtils.mkdirs(mediaFile.getParent().toFile(), true); + FileUtils.rename(tmpFile.toFile(), mediaFile.toFile()); + } + LfsPointer lfsPointer = new LfsPointer(loid, size); + lfsPointer.encode(out); + out.close(); + return -1; + } + } catch (IOException e) { + out.close(); + dOut.close(); + tmpOut.close(); + throw e; + } + } +}
diff --git a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/Lfs.java b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/Lfs.java new file mode 100644 index 0000000..f099c5a --- /dev/null +++ b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/Lfs.java
@@ -0,0 +1,124 @@ +/* + * Copyright (C) 2016, Christian Halstrick <christian.halstrick@sap.com> + * and other copyright owners as documented in the project's IP log. + * + * This program and the accompanying materials are made available + * under the terms of the Eclipse Distribution License v1.0 which + * accompanies this distribution, is reproduced below, and is + * available at http://www.eclipse.org/org/documents/edl-v10.php + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * + * - Neither the name of the Eclipse Foundation, Inc. nor the + * names of its contributors may be used to endorse or promote + * products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.eclipse.jgit.lfs; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; + +import org.eclipse.jgit.lfs.lib.LongObjectId; + +/** + * Class which represents the lfs folder hierarchy inside a .git folder + * + * @since 4.6 + */ +public class Lfs { + private Path root; + + private Path objDir; + + private Path tmpDir; + + /** + * @param root + * the path to the LFS media directory. Will be "<repo>/.git/lfs" + */ + public Lfs(Path root) { + this.root = root; + } + + /** + * @return the path to the LFS directory + */ + public Path getLfsRoot() { + return root; + } + + /** + * @return the path to the temp directory used by LFS. Will be + * "<repo>/.git/lfs/tmp" + */ + public Path getLfsTmpDir() { + if (tmpDir == null) { + tmpDir = root.resolve("tmp"); //$NON-NLS-1$ + } + return tmpDir; + } + + /** + * @return the path to the object directory used by LFS. Will be + * "<repo>/.git/lfs/objects" + */ + public Path getLfsObjDir() { + if (objDir == null) { + objDir = root.resolve("objects"); //$NON-NLS-1$ + } + return objDir; + } + + /** + * @param id + * the id of the mediafile + * @return the file which stores the original content. This will be files + * underneath + * "<repo>/.git/lfs/objects/<firstTwoLettersOfID>/<remainingLettersOfID>" + */ + public Path getMediaFile(LongObjectId id) { + String idStr = LongObjectId.toString(id); + return getLfsObjDir().resolve(idStr.substring(0, 2)) + .resolve(idStr.substring(2)); + } + + /** + * Create a new temp file in the LFS directory + * + * @return a new temporary file in the LFS directory + * @throws IOException + * when the temp file could not be created + */ + public Path createTmpFile() throws IOException { + return Files.createTempFile(getLfsTmpDir(), null, null); + } + +}
diff --git a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/LfsPointer.java b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/LfsPointer.java new file mode 100644 index 0000000..e43cb25 --- /dev/null +++ b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/LfsPointer.java
@@ -0,0 +1,167 @@ +/* + * Copyright (C) 2016, Christian Halstrick <christian.halstrick@sap.com> + * and other copyright owners as documented in the project's IP log. + * + * This program and the accompanying materials are made available + * under the terms of the Eclipse Distribution License v1.0 which + * accompanies this distribution, is reproduced below, and is + * available at http://www.eclipse.org/org/documents/edl-v10.php + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * + * - Neither the name of the Eclipse Foundation, Inc. nor the + * names of its contributors may be used to endorse or promote + * products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.eclipse.jgit.lfs; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.OutputStream; +import java.io.PrintStream; + +import org.eclipse.jgit.annotations.Nullable; +import org.eclipse.jgit.lfs.lib.Constants; +import org.eclipse.jgit.lfs.lib.LongObjectId; + +/** + * Represents an LFS pointer file + * + * @since 4.6 + */ +public class LfsPointer { + /** + * The version of the LfsPointer file format + */ + public static final String VERSION = "https://git-lfs.github.com/spec/v1"; //$NON-NLS-1$ + + /** + * The name of the hash function as used in the pointer files. This will + * evaluate to "sha256" + */ + public static final String HASH_FUNCTION_NAME = Constants.LONG_HASH_FUNCTION + .toLowerCase().replace("-", ""); //$NON-NLS-1$ //$NON-NLS-2$ + + private LongObjectId oid; + + private long size; + + /** + * @param oid + * the id of the content + * @param size + * the size of the content + */ + public LfsPointer(LongObjectId oid, long size) { + this.oid = oid; + this.size = size; + } + + /** + * @return the id of the content + */ + public LongObjectId getOid() { + return oid; + } + + /** + * @return the size of the content + */ + public long getSize() { + return size; + } + + /** + * Encode this object into the LFS format defined by {@link #VERSION} + * + * @param out + * the {@link OutputStream} into which the encoded data should be + * written + */ + public void encode(OutputStream out) { + try (PrintStream ps = new PrintStream(out)) { + ps.print("version "); //$NON-NLS-1$ + ps.println(VERSION); + ps.print("oid " + HASH_FUNCTION_NAME + ":"); //$NON-NLS-1$ //$NON-NLS-2$ + ps.println(LongObjectId.toString(oid)); + ps.print("size "); //$NON-NLS-1$ + ps.println(size); + } + } + + /** + * Try to parse the data provided by an InputStream to the format defined by + * {@link #VERSION} + * + * @param in + * the {@link InputStream} from where to read the data + * @return an {@link LfsPointer} or <code>null</code> if the stream was not + * parseable as LfsPointer + * @throws IOException + */ + @Nullable + public static LfsPointer parseLfsPointer(InputStream in) + throws IOException { + boolean versionLine = false; + LongObjectId id = null; + long sz = -1; + + try (BufferedReader br = new BufferedReader( + new InputStreamReader(in))) { + for (String s = br.readLine(); s != null; s = br.readLine()) { + if (s.startsWith("#") || s.length() == 0) { //$NON-NLS-1$ + continue; + } else if (s.startsWith("version") && s.length() > 8 //$NON-NLS-1$ + && s.substring(8).trim().equals(VERSION)) { + versionLine = true; + } else if (s.startsWith("oid sha256:")) { //$NON-NLS-1$ + id = LongObjectId.fromString(s.substring(11).trim()); + } else if (s.startsWith("size") && s.length() > 5) { //$NON-NLS-1$ + sz = Long.parseLong(s.substring(5).trim()); + } else { + return null; + } + } + if (versionLine && id != null && sz > -1) { + return new LfsPointer(id, sz); + } + } + return null; + } + + @Override + public String toString() { + return "LfsPointer: oid=" + LongObjectId.toString(oid) + ", size=" //$NON-NLS-1$ //$NON-NLS-2$ + + size; + } +} +
diff --git a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/SmudgeFilter.java b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/SmudgeFilter.java new file mode 100644 index 0000000..2332477 --- /dev/null +++ b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/SmudgeFilter.java
@@ -0,0 +1,125 @@ +/* + * Copyright (C) 2016, Christian Halstrick <christian.halstrick@sap.com> + * and other copyright owners as documented in the project's IP log. + * + * This program and the accompanying materials are made available + * under the terms of the Eclipse Distribution License v1.0 which + * accompanies this distribution, is reproduced below, and is + * available at http://www.eclipse.org/org/documents/edl-v10.php + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * + * - Neither the name of the Eclipse Foundation, Inc. nor the + * names of its contributors may be used to endorse or promote + * products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.eclipse.jgit.lfs; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.nio.file.Files; +import java.nio.file.Path; + +import org.eclipse.jgit.attributes.FilterCommand; +import org.eclipse.jgit.attributes.FilterCommandFactory; +import org.eclipse.jgit.attributes.FilterCommandRegistry; +import org.eclipse.jgit.lfs.lib.Constants; +import org.eclipse.jgit.lib.Repository; + +/** + * Built-in LFS smudge filter + * + * When content is read from git's object-database and written to the filesystem + * and this filter is configured for that content, then this filter will replace + * the content of LFS pointer files with the original content. This happens e.g. + * when a checkout needs to update a working tree file which is under LFS + * control. This implementation expects that the origin content is already + * available in the .git/lfs/objects folder. This implementation will not + * contact any LFS servers in order to get the missing content. + * + * @since 4.6 + */ +public class SmudgeFilter extends FilterCommand { + /** + * The factory is responsible for creating instances of {@link SmudgeFilter} + */ + public final static FilterCommandFactory FACTORY = new FilterCommandFactory() { + @Override + public FilterCommand create(Repository db, InputStream in, + OutputStream out) throws IOException { + return new SmudgeFilter(db, in, out); + } + }; + + /** + * Registers this filter in JGit by calling + */ + public final static void register() { + FilterCommandRegistry.register( + org.eclipse.jgit.lib.Constants.BUILTIN_FILTER_PREFIX + + "lfs/smudge", //$NON-NLS-1$ + FACTORY); + } + + private Lfs lfs; + + /** + * @param db + * @param in + * @param out + * @throws IOException + */ + public SmudgeFilter(Repository db, InputStream in, OutputStream out) + throws IOException { + super(in, out); + lfs = new Lfs(db.getDirectory().toPath().resolve(Constants.LFS)); + LfsPointer res = LfsPointer.parseLfsPointer(in); + if (res != null) { + Path mediaFile = lfs.getMediaFile(res.getOid()); + if (Files.exists(mediaFile)) { + this.in = Files.newInputStream(mediaFile); + } + } + } + + @Override + public int run() throws IOException { + int b; + if (in != null) { + while ((b = in.read()) != -1) { + out.write(b); + } + in.close(); + } + out.close(); + return -1; + } +}
diff --git a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/errors/CorruptMediaFile.java b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/errors/CorruptMediaFile.java new file mode 100644 index 0000000..f2b51c0 --- /dev/null +++ b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/errors/CorruptMediaFile.java
@@ -0,0 +1,100 @@ +/* + * Copyright (C) 2016, Christian Halstrick <christian.halstrick@sap.com> + * and other copyright owners as documented in the project's IP log. + * + * This program and the accompanying materials are made available + * under the terms of the Eclipse Distribution License v1.0 which + * accompanies this distribution, is reproduced below, and is + * available at http://www.eclipse.org/org/documents/edl-v10.php + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * + * - Neither the name of the Eclipse Foundation, Inc. nor the + * names of its contributors may be used to endorse or promote + * products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.eclipse.jgit.lfs.errors; + +import java.io.IOException; +import java.nio.file.Path; +import java.text.MessageFormat; + +import org.eclipse.jgit.lfs.internal.LfsText; + +/** + * Thrown when a LFS mediafile is found which doesn't have the expected size + * + * @since 4.6 + */ +public class CorruptMediaFile extends IOException { + private static final long serialVersionUID = 1L; + + private Path mediaFile; + + private long expectedSize; + + private long size; + + /** + * @param mediaFile + * @param expectedSize + * @param size + */ + @SuppressWarnings("boxing") + public CorruptMediaFile(Path mediaFile, long expectedSize, + long size) { + super(MessageFormat.format(LfsText.get().inconsistentMediafileLength, + mediaFile, expectedSize, size)); + this.mediaFile = mediaFile; + this.expectedSize = expectedSize; + this.size = size; + } + + /** + * @return the media file which seems to be corrupt + */ + public Path getMediaFile() { + return mediaFile; + } + + /** + * @return the expected size of the media file + */ + public long getExpectedSize() { + return expectedSize; + } + + /** + * @return the actual size of the media file in the file system + */ + public long getSize() { + return size; + } +}
diff --git a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/AtomicObjectOutputStream.java b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal/AtomicObjectOutputStream.java similarity index 90% rename from org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/AtomicObjectOutputStream.java rename to org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal/AtomicObjectOutputStream.java index ecc7c1f..7e050b1 100644 --- a/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/AtomicObjectOutputStream.java +++ b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal/AtomicObjectOutputStream.java
@@ -40,7 +40,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package org.eclipse.jgit.lfs.server.fs; +package org.eclipse.jgit.lfs.internal; import java.io.IOException; import java.io.OutputStream; @@ -53,14 +53,13 @@ import org.eclipse.jgit.lfs.lib.AnyLongObjectId; import org.eclipse.jgit.lfs.lib.Constants; import org.eclipse.jgit.lfs.lib.LongObjectId; -import org.eclipse.jgit.lfs.server.internal.LfsServerText; /** * Output stream writing content to a {@link LockFile} which is committed on * close(). The stream checks if the hash of the stream content matches the * id. */ -class AtomicObjectOutputStream extends OutputStream { +public class AtomicObjectOutputStream extends OutputStream { private LockFile locked; @@ -70,7 +69,12 @@ class AtomicObjectOutputStream extends OutputStream { private AnyLongObjectId id; - AtomicObjectOutputStream(Path path, AnyLongObjectId id) + /** + * @param path + * @param id + * @throws IOException + */ + public AtomicObjectOutputStream(Path path, AnyLongObjectId id) throws IOException { locked = new LockFile(path.toFile()); locked.lock(); @@ -109,12 +113,15 @@ private void verifyHash() { if (!contentHash.equals(id)) { abort(); throw new CorruptLongObjectException(id, contentHash, - MessageFormat.format(LfsServerText.get().corruptLongObject, + MessageFormat.format(LfsText.get().corruptLongObject, contentHash, id)); } } - void abort() { + /** + * Aborts the stream. Temporary file will be deleted + */ + public void abort() { locked.unlock(); aborted = true; }
diff --git a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal/LfsText.java b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal/LfsText.java index 365eaa1..c76df39 100644 --- a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal/LfsText.java +++ b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/internal/LfsText.java
@@ -58,6 +58,8 @@ public static LfsText get() { } // @formatter:off + /***/ public String corruptLongObject; + /***/ public String inconsistentMediafileLength; /***/ public String incorrectLONG_OBJECT_ID_LENGTH; /***/ public String invalidLongId; /***/ public String invalidLongIdLength;
diff --git a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/lib/Constants.java b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/lib/Constants.java index d246412..20e87ae 100644 --- a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/lib/Constants.java +++ b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/lib/Constants.java
@@ -55,8 +55,19 @@ **/ @SuppressWarnings("nls") public final class Constants { - /** Hash function used natively by Git LFS extension for large objects. */ - private static final String LONG_HASH_FUNCTION = "SHA-256"; + /** + * lfs folder + * + * @since 4.6 + */ + public static final String LFS = "lfs"; + + /** + * Hash function used natively by Git LFS extension for large objects. + * + * @since 4.6 + */ + public static final String LONG_HASH_FUNCTION = "SHA-256"; /** * A Git LFS large object hash is 256 bits, i.e. 32 bytes.
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.feature/feature.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.feature/feature.xml index 091073c..75573d7 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.feature/feature.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.feature/feature.xml
@@ -2,7 +2,7 @@ <feature id="org.eclipse.jgit" label="%featureName" - version="4.5.1.qualifier" + version="4.6.0.qualifier" provider-name="%providerName"> <description url="http://www.eclipse.org/jgit/">
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.feature/pom.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.feature/pom.xml index c559f8e..8a7d70a 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.feature/pom.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.feature/pom.xml
@@ -50,7 +50,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>jgit.tycho.parent</artifactId> - <version>4.5.1-SNAPSHOT</version> + <version>4.6.0-SNAPSHOT</version> </parent> <groupId>org.eclipse.jgit.feature</groupId>
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.http.apache.feature/feature.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.http.apache.feature/feature.xml index 9a327b8..0233f2a 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.http.apache.feature/feature.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.http.apache.feature/feature.xml
@@ -2,7 +2,7 @@ <feature id="org.eclipse.jgit.http.apache" label="%featureName" - version="4.5.1.qualifier" + version="4.6.0.qualifier" provider-name="%providerName"> <description url="http://www.eclipse.org/jgit/">
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.http.apache.feature/pom.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.http.apache.feature/pom.xml index 8812d8c..5ebee12 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.http.apache.feature/pom.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.http.apache.feature/pom.xml
@@ -50,7 +50,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>jgit.tycho.parent</artifactId> - <version>4.5.1-SNAPSHOT</version> + <version>4.6.0-SNAPSHOT</version> </parent> <groupId>org.eclipse.jgit.feature</groupId>
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.junit.feature/feature.properties b/org.eclipse.jgit.packaging/org.eclipse.jgit.junit.feature/feature.properties index 9ef46ba..4450bbb 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.junit.feature/feature.properties +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.junit.feature/feature.properties
@@ -9,14 +9,13 @@ # ############################################################################### -featureName=JUnit test support for Java implementation of Git +featureName=Java implementation of Git - JUnit test support providerName=Eclipse JGit updateSiteName=Eclipse JGit Update Site # description property - text of the "Feature Description" -description=\ -JUnit test support for JGit.\n +description=JUnit test support for JGit ################ end of description property ################################## # "copyright" property - text of the "Feature Update Copyright"
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.junit.feature/feature.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.junit.feature/feature.xml index d96081e..45c320e 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.junit.feature/feature.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.junit.feature/feature.xml
@@ -2,7 +2,7 @@ <feature id="org.eclipse.jgit.junit" label="%featureName" - version="4.5.1.qualifier" + version="4.6.0.qualifier" provider-name="%providerName"> <description url="http://www.eclipse.org/jgit/">
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.junit.feature/pom.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.junit.feature/pom.xml index 82e6045..9db144c 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.junit.feature/pom.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.junit.feature/pom.xml
@@ -50,7 +50,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>jgit.tycho.parent</artifactId> - <version>4.5.1-SNAPSHOT</version> + <version>4.6.0-SNAPSHOT</version> </parent> <groupId>org.eclipse.jgit.feature</groupId>
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.lfs.feature/feature.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.lfs.feature/feature.xml index c19f7cd..47a09d2 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.lfs.feature/feature.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.lfs.feature/feature.xml
@@ -2,7 +2,7 @@ <feature id="org.eclipse.jgit.lfs" label="%featureName" - version="4.5.1.qualifier" + version="4.6.0.qualifier" provider-name="%providerName"> <description url="http://www.eclipse.org/jgit/">
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.lfs.feature/pom.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.lfs.feature/pom.xml index dc9b60d..b3379f8 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.lfs.feature/pom.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.lfs.feature/pom.xml
@@ -50,7 +50,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>jgit.tycho.parent</artifactId> - <version>4.5.1-SNAPSHOT</version> + <version>4.6.0-SNAPSHOT</version> </parent> <groupId>org.eclipse.jgit.feature</groupId>
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.feature/feature.properties b/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.feature/feature.properties index 1d1130a..8992ad3 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.feature/feature.properties +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.feature/feature.properties
@@ -8,14 +8,14 @@ # ############################################################################### -featureName=Command Line Interface for Java implementation of Git +featureName=Java implementation of Git - Command Line Interface providerName=Eclipse JGit updateSiteName=Eclipse JGit Update Site # description property - text of the "Feature Description" description=\ -Command line interface for a pure Java implementation of the Git version control system.\n +Command line interface for a pure Java implementation of the Git version control system ################ end of description property ################################## # "copyright" property - text of the "Feature Update Copyright"
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.feature/feature.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.feature/feature.xml index 04c47ee..1f69a51 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.feature/feature.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.feature/feature.xml
@@ -2,7 +2,7 @@ <feature id="org.eclipse.jgit.pgm" label="%featureName" - version="4.5.1.qualifier" + version="4.6.0.qualifier" provider-name="%providerName"> <description url="http://www.eclipse.org/jgit/"> @@ -31,8 +31,8 @@ version="0.0.0"/> <requires> - <import feature="org.eclipse.jgit" version="4.5.0" match="equivalent"/> - <import feature="org.eclipse.jgit.lfs" version="4.5.0" match="equivalent"/> + <import feature="org.eclipse.jgit" version="4.6.0" match="equivalent"/> + <import feature="org.eclipse.jgit.lfs" version="4.6.0" match="equivalent"/> </requires> <plugin
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.feature/pom.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.feature/pom.xml index 3fe17a7..d00064e 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.feature/pom.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.feature/pom.xml
@@ -50,7 +50,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>jgit.tycho.parent</artifactId> - <version>4.5.1-SNAPSHOT</version> + <version>4.6.0-SNAPSHOT</version> </parent> <groupId>org.eclipse.jgit.feature</groupId>
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.source.feature/feature.properties b/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.source.feature/feature.properties index 20d6641..012c217 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.source.feature/feature.properties +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.source.feature/feature.properties
@@ -8,7 +8,7 @@ # ############################################################################### -featureName=Command Line Interface for Java implementation of Git - Source Code +featureName=Java implementation of Git - Command Line Interface - Source Code providerName=Eclipse JGit updateSiteName=Eclipse JGit Update Site
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.source.feature/feature.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.source.feature/feature.xml index 3696886..8584ee1 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.source.feature/feature.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.source.feature/feature.xml
@@ -2,7 +2,7 @@ <feature id="org.eclipse.jgit.pgm.source" label="%featureName" - version="4.5.1.qualifier" + version="4.6.0.qualifier" provider-name="%providerName"> <description url="http://www.eclipse.org/jgit/">
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.source.feature/pom.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.source.feature/pom.xml index e3dab5f..d5e1168 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.source.feature/pom.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.pgm.source.feature/pom.xml
@@ -50,7 +50,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>jgit.tycho.parent</artifactId> - <version>4.5.1-SNAPSHOT</version> + <version>4.6.0-SNAPSHOT</version> </parent> <groupId>org.eclipse.jgit.feature</groupId>
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.repository/category.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.repository/category.xml index 15d10e6..0149029 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.repository/category.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.repository/category.xml
@@ -24,9 +24,9 @@ <feature url="features/org.eclipse.jgit.lfs_0.0.0.qualifier.jar" id="org.eclipse.jgit.lfs" version="0.0.0"> <category name="JGit"/> </feature> - <category-def name="JGit" label="JGit"> + <category-def name="JGit" label="Java implementation of Git"> <description> - JGit + Java implementation of Git </description> </category-def> </site>
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.repository/pom.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.repository/pom.xml index b9d9f54..e441fce 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.repository/pom.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.repository/pom.xml
@@ -50,7 +50,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>jgit.tycho.parent</artifactId> - <version>4.5.1-SNAPSHOT</version> + <version>4.6.0-SNAPSHOT</version> </parent> <artifactId>org.eclipse.jgit.repository</artifactId>
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.source.feature/feature.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.source.feature/feature.xml index 90b4c3d..c2fb82e 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.source.feature/feature.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.source.feature/feature.xml
@@ -2,7 +2,7 @@ <feature id="org.eclipse.jgit.source" label="%featureName" - version="4.5.1.qualifier" + version="4.6.0.qualifier" provider-name="%providerName"> <description url="http://www.eclipse.org/jgit/">
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.source.feature/pom.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.source.feature/pom.xml index 69b68df..3e3add4 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.source.feature/pom.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.source.feature/pom.xml
@@ -50,7 +50,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>jgit.tycho.parent</artifactId> - <version>4.5.1-SNAPSHOT</version> + <version>4.6.0-SNAPSHOT</version> </parent> <groupId>org.eclipse.jgit.feature</groupId>
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/.classpath b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/.classpath index 098194c..eca7bdb 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/.classpath +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/.classpath
@@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <classpath> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> <classpathentry kind="src" path="src"/> <classpathentry kind="output" path="bin"/>
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/META-INF/MANIFEST.MF b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/META-INF/MANIFEST.MF index d25905c..6854007 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/META-INF/MANIFEST.MF
@@ -2,4 +2,4 @@ Bundle-ManifestVersion: 2 Bundle-Name: JGit Target Platform Bundle Bundle-SymbolicName: org.eclipse.jgit.target -Bundle-Version: 4.5.1.qualifier +Bundle-Version: 4.6.0.qualifier
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/pom.xml b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/pom.xml index 5b79034..fc33622 100644 --- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/pom.xml +++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/pom.xml
@@ -49,7 +49,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>jgit.tycho.parent</artifactId> - <version>4.5.1-SNAPSHOT</version> + <version>4.6.0-SNAPSHOT</version> </parent> <artifactId>org.eclipse.jgit.target</artifactId>
diff --git a/org.eclipse.jgit.packaging/pom.xml b/org.eclipse.jgit.packaging/pom.xml index 50b11ac..cf4d740 100644 --- a/org.eclipse.jgit.packaging/pom.xml +++ b/org.eclipse.jgit.packaging/pom.xml
@@ -53,7 +53,7 @@ <groupId>org.eclipse.jgit</groupId> <artifactId>jgit.tycho.parent</artifactId> - <version>4.5.1-SNAPSHOT</version> + <version>4.6.0-SNAPSHOT</version> <packaging>pom</packaging> <name>JGit Tycho Parent</name> @@ -142,8 +142,8 @@ <version>${tycho-version}</version> <configuration> <encoding>UTF-8</encoding> - <source>1.7</source> - <target>1.7</target> + <source>1.8</source> + <target>1.8</target> </configuration> </plugin> <plugin>
diff --git a/org.eclipse.jgit.pgm.test/.classpath b/org.eclipse.jgit.pgm.test/.classpath index 30d83d8..b26f4c4 100644 --- a/org.eclipse.jgit.pgm.test/.classpath +++ b/org.eclipse.jgit.pgm.test/.classpath
@@ -2,7 +2,7 @@ <classpath> <classpathentry kind="src" path="tst"/> <classpathentry kind="src" path="src"/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> <classpathentry kind="output" path="bin"/> </classpath>
diff --git a/org.eclipse.jgit.pgm.test/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.pgm.test/.settings/org.eclipse.jdt.core.prefs index 87210fb..10c29d5 100644 --- a/org.eclipse.jgit.pgm.test/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.jgit.pgm.test/.settings/org.eclipse.jdt.core.prefs
@@ -7,9 +7,9 @@ org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate @@ -112,7 +112,7 @@ org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=error -org.eclipse.jdt.core.compiler.source=1.7 +org.eclipse.jdt.core.compiler.source=1.8 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
diff --git a/org.eclipse.jgit.pgm.test/META-INF/MANIFEST.MF b/org.eclipse.jgit.pgm.test/META-INF/MANIFEST.MF index 77d441b..45e3692 100644 --- a/org.eclipse.jgit.pgm.test/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.pgm.test/META-INF/MANIFEST.MF
@@ -2,28 +2,28 @@ Bundle-ManifestVersion: 2 Bundle-Name: %plugin_name Bundle-SymbolicName: org.eclipse.jgit.pgm.test -Bundle-Version: 4.5.1.qualifier +Bundle-Version: 4.6.0.qualifier Bundle-Vendor: %provider_name Bundle-Localization: plugin Bundle-ActivationPolicy: lazy -Bundle-RequiredExecutionEnvironment: JavaSE-1.7 -Import-Package: org.eclipse.jgit.api;version="[4.5.1,4.6.0)", - org.eclipse.jgit.api.errors;version="[4.5.1,4.6.0)", - org.eclipse.jgit.diff;version="[4.5.1,4.6.0)", - org.eclipse.jgit.dircache;version="[4.5.1,4.6.0)", - org.eclipse.jgit.internal.storage.file;version="4.5.1", - org.eclipse.jgit.junit;version="[4.5.1,4.6.0)", - org.eclipse.jgit.lib;version="[4.5.1,4.6.0)", - org.eclipse.jgit.merge;version="[4.5.1,4.6.0)", - org.eclipse.jgit.pgm;version="[4.5.1,4.6.0)", - org.eclipse.jgit.pgm.internal;version="[4.5.1,4.6.0)", - org.eclipse.jgit.pgm.opt;version="[4.5.1,4.6.0)", - org.eclipse.jgit.revwalk;version="[4.5.1,4.6.0)", - org.eclipse.jgit.storage.file;version="[4.5.1,4.6.0)", - org.eclipse.jgit.transport;version="[4.5.1,4.6.0)", - org.eclipse.jgit.treewalk;version="[4.5.1,4.6.0)", - org.eclipse.jgit.util;version="[4.5.1,4.6.0)", - org.eclipse.jgit.util.io;version="[4.5.1,4.6.0)", +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Import-Package: org.eclipse.jgit.api;version="[4.6.0,4.7.0)", + org.eclipse.jgit.api.errors;version="[4.6.0,4.7.0)", + org.eclipse.jgit.diff;version="[4.6.0,4.7.0)", + org.eclipse.jgit.dircache;version="[4.6.0,4.7.0)", + org.eclipse.jgit.internal.storage.file;version="4.6.0", + org.eclipse.jgit.junit;version="[4.6.0,4.7.0)", + org.eclipse.jgit.lib;version="[4.6.0,4.7.0)", + org.eclipse.jgit.merge;version="[4.6.0,4.7.0)", + org.eclipse.jgit.pgm;version="[4.6.0,4.7.0)", + org.eclipse.jgit.pgm.internal;version="[4.6.0,4.7.0)", + org.eclipse.jgit.pgm.opt;version="[4.6.0,4.7.0)", + org.eclipse.jgit.revwalk;version="[4.6.0,4.7.0)", + org.eclipse.jgit.storage.file;version="[4.6.0,4.7.0)", + org.eclipse.jgit.transport;version="[4.6.0,4.7.0)", + org.eclipse.jgit.treewalk;version="[4.6.0,4.7.0)", + org.eclipse.jgit.util;version="[4.6.0,4.7.0)", + org.eclipse.jgit.util.io;version="[4.6.0,4.7.0)", org.hamcrest.core;bundle-version="[1.1.0,2.0.0)", org.junit;version="[4.11.0,5.0.0)", org.junit.rules;version="[4.11.0,5.0.0)",
diff --git "a/org.eclipse.jgit.pgm.test/org.eclipse.jgit.pgm--All-Tests \050Java7\051.launch" "b/org.eclipse.jgit.pgm.test/org.eclipse.jgit.pgm--All-Tests \050Java7\051.launch" deleted file mode 100644 index 3df0dcb..0000000 --- "a/org.eclipse.jgit.pgm.test/org.eclipse.jgit.pgm--All-Tests \050Java7\051.launch" +++ /dev/null
@@ -1,21 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<launchConfiguration type="org.eclipse.jdt.junit.launchconfig"> -<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> -<listEntry value="/org.eclipse.jgit.pgm.test/tst"/> -</listAttribute> -<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> -<listEntry value="2"/> -</listAttribute> -<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/> -<listAttribute key="org.eclipse.debug.ui.favoriteGroups"> -<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/> -<listEntry value="org.eclipse.debug.ui.launchGroup.run"/> -</listAttribute> -<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=org.eclipse.jgit.pgm.test/tst"/> -<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/> -<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/> -<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/> -<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/> -<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/> -<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.jgit.pgm.test"/> -</launchConfiguration>
diff --git "a/org.eclipse.jgit.pgm.test/org.eclipse.jgit.pgm--All-Tests \050Java8\051 \050de\051.launch" "b/org.eclipse.jgit.pgm.test/org.eclipse.jgit.pgm--All-Tests \050Java8\051 \050de\051.launch" index 5c137f2..e11b72f 100644 --- "a/org.eclipse.jgit.pgm.test/org.eclipse.jgit.pgm--All-Tests \050Java8\051 \050de\051.launch" +++ "b/org.eclipse.jgit.pgm.test/org.eclipse.jgit.pgm--All-Tests \050Java8\051 \050de\051.launch"
@@ -20,7 +20,7 @@ <stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/> <booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/> <listAttribute key="org.eclipse.jdt.launching.CLASSPATH"> -<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7" path="1" type="4"/> "/> +<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8" path="1" type="4"/> "/> <listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry id="org.eclipse.jdt.launching.classpathentry.defaultClasspath"> <memento exportedEntriesOnly="false" project="org.eclipse.jgit.pgm.test"/> </runtimeClasspathEntry> "/> </listAttribute> <booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
diff --git "a/org.eclipse.jgit.pgm.test/org.eclipse.jgit.pgm--All-Tests \050Java8\051.launch" "b/org.eclipse.jgit.pgm.test/org.eclipse.jgit.pgm--All-Tests \050Java8\051.launch" index ce473ed..8b0452a 100644 --- "a/org.eclipse.jgit.pgm.test/org.eclipse.jgit.pgm--All-Tests \050Java8\051.launch" +++ "b/org.eclipse.jgit.pgm.test/org.eclipse.jgit.pgm--All-Tests \050Java8\051.launch"
@@ -17,7 +17,7 @@ <stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/> <booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/> <listAttribute key="org.eclipse.jdt.launching.CLASSPATH"> -<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7" path="1" type="4"/> "/> +<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8" path="1" type="4"/> "/> <listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry id="org.eclipse.jdt.launching.classpathentry.defaultClasspath"> <memento exportedEntriesOnly="false" project="org.eclipse.jgit.pgm.test"/> </runtimeClasspathEntry> "/> </listAttribute> <booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
diff --git a/org.eclipse.jgit.pgm.test/pom.xml b/org.eclipse.jgit.pgm.test/pom.xml index ff9a668..f5d0bd3 100644 --- a/org.eclipse.jgit.pgm.test/pom.xml +++ b/org.eclipse.jgit.pgm.test/pom.xml
@@ -50,7 +50,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit-parent</artifactId> - <version>4.5.1-SNAPSHOT</version> + <version>4.6.0-SNAPSHOT</version> </parent> <artifactId>org.eclipse.jgit.pgm.test</artifactId>
diff --git a/org.eclipse.jgit.pgm/.classpath b/org.eclipse.jgit.pgm/.classpath index c5d5a57..e8bc977 100644 --- a/org.eclipse.jgit.pgm/.classpath +++ b/org.eclipse.jgit.pgm/.classpath
@@ -3,7 +3,7 @@ <classpathentry kind="src" path="src"/> <classpathentry excluding="*|resources/|resources/" including="META-INF/" kind="src" path=""/> <classpathentry kind="src" path="resources"/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> <classpathentry kind="output" path="bin"/> </classpath>
diff --git a/org.eclipse.jgit.pgm/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.pgm/.settings/org.eclipse.jdt.core.prefs index bfaf736..4f1759f 100644 --- a/org.eclipse.jgit.pgm/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.jgit.pgm/.settings/org.eclipse.jdt.core.prefs
@@ -7,9 +7,9 @@ org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate @@ -112,7 +112,7 @@ org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=error -org.eclipse.jdt.core.compiler.source=1.7 +org.eclipse.jdt.core.compiler.source=1.8 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
diff --git a/org.eclipse.jgit.pgm/BUCK b/org.eclipse.jgit.pgm/BUCK index 47711b5..5d5e6f7 100644 --- a/org.eclipse.jgit.pgm/BUCK +++ b/org.eclipse.jgit.pgm/BUCK
@@ -9,6 +9,7 @@ '//org.eclipse.jgit:jgit', '//org.eclipse.jgit.archive:jgit-archive', '//org.eclipse.jgit.http.apache:http-apache', + '//org.eclipse.jgit.lfs:jgit-lfs', '//org.eclipse.jgit.lfs.server:jgit-lfs-server', '//org.eclipse.jgit.ui:ui', '//lib:args4j',
diff --git a/org.eclipse.jgit.pgm/META-INF/MANIFEST.MF b/org.eclipse.jgit.pgm/META-INF/MANIFEST.MF index c3599bf..ad400b3 100644 --- a/org.eclipse.jgit.pgm/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.pgm/META-INF/MANIFEST.MF
@@ -2,11 +2,11 @@ Bundle-ManifestVersion: 2 Bundle-Name: %plugin_name Bundle-SymbolicName: org.eclipse.jgit.pgm -Bundle-Version: 4.5.1.qualifier +Bundle-Version: 4.6.0.qualifier Bundle-Vendor: %provider_name Bundle-ActivationPolicy: lazy Bundle-Localization: plugin -Bundle-RequiredExecutionEnvironment: JavaSE-1.7 +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: javax.servlet;version="[3.1.0,4.0.0)", javax.servlet.http;version="[3.1.0,4.0.0)", org.apache.commons.compress.archivers;version="[1.3,2.0)", @@ -26,45 +26,46 @@ org.eclipse.jetty.util.log;version="[9.0.0,10.0.0)", org.eclipse.jetty.util.security;version="[9.0.0,10.0.0)", org.eclipse.jetty.util.thread;version="[9.0.0,10.0.0)", - org.eclipse.jgit.api;version="[4.5.1,4.6.0)", - org.eclipse.jgit.api.errors;version="[4.5.1,4.6.0)", - org.eclipse.jgit.archive;version="[4.5.1,4.6.0)", - org.eclipse.jgit.awtui;version="[4.5.1,4.6.0)", - org.eclipse.jgit.blame;version="[4.5.1,4.6.0)", - org.eclipse.jgit.diff;version="[4.5.1,4.6.0)", - org.eclipse.jgit.dircache;version="[4.5.1,4.6.0)", - org.eclipse.jgit.errors;version="[4.5.1,4.6.0)", - org.eclipse.jgit.gitrepo;version="[4.5.1,4.6.0)", - org.eclipse.jgit.internal.ketch;version="[4.5.1,4.6.0)", - org.eclipse.jgit.internal.storage.file;version="[4.5.1,4.6.0)", - org.eclipse.jgit.internal.storage.pack;version="[4.5.1,4.6.0)", - org.eclipse.jgit.internal.storage.reftree;version="[4.5.1,4.6.0)", - org.eclipse.jgit.lfs.lib;version="[4.5.1,4.6.0)", - org.eclipse.jgit.lfs.server;version="[4.5.1,4.6.0)", - org.eclipse.jgit.lfs.server.fs;version="[4.5.1,4.6.0)", - org.eclipse.jgit.lfs.server.s3;version="[4.5.1,4.6.0)", - org.eclipse.jgit.lib;version="[4.5.1,4.6.0)", - org.eclipse.jgit.merge;version="[4.5.1,4.6.0)", - org.eclipse.jgit.nls;version="[4.5.1,4.6.0)", - org.eclipse.jgit.notes;version="[4.5.1,4.6.0)", - org.eclipse.jgit.revplot;version="[4.5.1,4.6.0)", - org.eclipse.jgit.revwalk;version="[4.5.1,4.6.0)", - org.eclipse.jgit.revwalk.filter;version="[4.5.1,4.6.0)", - org.eclipse.jgit.storage.file;version="[4.5.1,4.6.0)", - org.eclipse.jgit.storage.pack;version="[4.5.1,4.6.0)", - org.eclipse.jgit.transport;version="[4.5.1,4.6.0)", - org.eclipse.jgit.transport.http.apache;version="[4.5.1,4.6.0)", - org.eclipse.jgit.transport.resolver;version="[4.5.1,4.6.0)", - org.eclipse.jgit.treewalk;version="[4.5.1,4.6.0)", - org.eclipse.jgit.treewalk.filter;version="[4.5.1,4.6.0)", - org.eclipse.jgit.util;version="[4.5.1,4.6.0)", - org.eclipse.jgit.util.io;version="[4.5.1,4.6.0)", + org.eclipse.jgit.api;version="[4.6.0,4.7.0)", + org.eclipse.jgit.api.errors;version="[4.6.0,4.7.0)", + org.eclipse.jgit.archive;version="[4.6.0,4.7.0)", + org.eclipse.jgit.awtui;version="[4.6.0,4.7.0)", + org.eclipse.jgit.blame;version="[4.6.0,4.7.0)", + org.eclipse.jgit.diff;version="[4.6.0,4.7.0)", + org.eclipse.jgit.dircache;version="[4.6.0,4.7.0)", + org.eclipse.jgit.errors;version="[4.6.0,4.7.0)", + org.eclipse.jgit.gitrepo;version="[4.6.0,4.7.0)", + org.eclipse.jgit.internal.ketch;version="[4.6.0,4.7.0)", + org.eclipse.jgit.internal.storage.file;version="[4.6.0,4.7.0)", + org.eclipse.jgit.internal.storage.pack;version="[4.6.0,4.7.0)", + org.eclipse.jgit.internal.storage.reftree;version="[4.6.0,4.7.0)", + org.eclipse.jgit.lfs;version="[4.6.0,4.7.0)", + org.eclipse.jgit.lfs.lib;version="[4.6.0,4.7.0)", + org.eclipse.jgit.lfs.server;version="[4.6.0,4.7.0)", + org.eclipse.jgit.lfs.server.fs;version="[4.6.0,4.7.0)", + org.eclipse.jgit.lfs.server.s3;version="[4.6.0,4.7.0)", + org.eclipse.jgit.lib;version="[4.6.0,4.7.0)", + org.eclipse.jgit.merge;version="[4.6.0,4.7.0)", + org.eclipse.jgit.nls;version="[4.6.0,4.7.0)", + org.eclipse.jgit.notes;version="[4.6.0,4.7.0)", + org.eclipse.jgit.revplot;version="[4.6.0,4.7.0)", + org.eclipse.jgit.revwalk;version="[4.6.0,4.7.0)", + org.eclipse.jgit.revwalk.filter;version="[4.6.0,4.7.0)", + org.eclipse.jgit.storage.file;version="[4.6.0,4.7.0)", + org.eclipse.jgit.storage.pack;version="[4.6.0,4.7.0)", + org.eclipse.jgit.transport;version="[4.6.0,4.7.0)", + org.eclipse.jgit.transport.http.apache;version="[4.6.0,4.7.0)", + org.eclipse.jgit.transport.resolver;version="[4.6.0,4.7.0)", + org.eclipse.jgit.treewalk;version="[4.6.0,4.7.0)", + org.eclipse.jgit.treewalk.filter;version="[4.6.0,4.7.0)", + org.eclipse.jgit.util;version="[4.6.0,4.7.0)", + org.eclipse.jgit.util.io;version="[4.6.0,4.7.0)", org.kohsuke.args4j;version="[2.0.12,2.1.0)", org.kohsuke.args4j.spi;version="[2.0.15,2.1.0)" -Export-Package: org.eclipse.jgit.console;version="4.5.1"; +Export-Package: org.eclipse.jgit.console;version="4.6.0"; uses:="org.eclipse.jgit.transport, org.eclipse.jgit.util", - org.eclipse.jgit.pgm;version="4.5.1"; + org.eclipse.jgit.pgm;version="4.6.0"; uses:="org.eclipse.jgit.revwalk, org.eclipse.jgit.treewalk.filter, org.eclipse.jgit.pgm.opt, @@ -75,11 +76,11 @@ org.eclipse.jgit.treewalk, javax.swing, org.eclipse.jgit.transport", - org.eclipse.jgit.pgm.debug;version="4.5.1"; + org.eclipse.jgit.pgm.debug;version="4.6.0"; uses:="org.eclipse.jgit.util.io, org.eclipse.jgit.pgm", - org.eclipse.jgit.pgm.internal;version="4.5.1";x-friends:="org.eclipse.jgit.pgm.test,org.eclipse.jgit.test", - org.eclipse.jgit.pgm.opt;version="4.5.1"; + org.eclipse.jgit.pgm.internal;version="4.6.0";x-friends:="org.eclipse.jgit.pgm.test,org.eclipse.jgit.test", + org.eclipse.jgit.pgm.opt;version="4.6.0"; uses:="org.eclipse.jgit.lib, org.eclipse.jgit.revwalk, org.kohsuke.args4j.spi,
diff --git a/org.eclipse.jgit.pgm/META-INF/SOURCE-MANIFEST.MF b/org.eclipse.jgit.pgm/META-INF/SOURCE-MANIFEST.MF index e6809c2..3378a8c 100644 --- a/org.eclipse.jgit.pgm/META-INF/SOURCE-MANIFEST.MF +++ b/org.eclipse.jgit.pgm/META-INF/SOURCE-MANIFEST.MF
@@ -3,5 +3,5 @@ Bundle-Name: org.eclipse.jgit.pgm - Sources Bundle-SymbolicName: org.eclipse.jgit.pgm.source Bundle-Vendor: Eclipse.org - JGit -Bundle-Version: 4.5.1.qualifier -Eclipse-SourceBundle: org.eclipse.jgit.pgm;version="4.5.1.qualifier";roots="." +Bundle-Version: 4.6.0.qualifier +Eclipse-SourceBundle: org.eclipse.jgit.pgm;version="4.6.0.qualifier";roots="."
diff --git a/org.eclipse.jgit.pgm/pom.xml b/org.eclipse.jgit.pgm/pom.xml index 99945ab..61979c8 100644 --- a/org.eclipse.jgit.pgm/pom.xml +++ b/org.eclipse.jgit.pgm/pom.xml
@@ -50,7 +50,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit-parent</artifactId> - <version>4.5.1-SNAPSHOT</version> + <version>4.6.0-SNAPSHOT</version> </parent> <artifactId>org.eclipse.jgit.pgm</artifactId>
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Main.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Main.java index d701f22..3ddee36 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Main.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Main.java
@@ -57,6 +57,8 @@ import org.eclipse.jgit.awtui.AwtAuthenticator; import org.eclipse.jgit.awtui.AwtCredentialsProvider; import org.eclipse.jgit.errors.TransportException; +import org.eclipse.jgit.lfs.CleanFilter; +import org.eclipse.jgit.lfs.SmudgeFilter; import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.lib.RepositoryBuilder; import org.eclipse.jgit.pgm.internal.CLIText; @@ -97,6 +99,8 @@ public class Main { */ public Main() { HttpTransport.setConnectionFactory(new HttpClientConnectionFactory()); + CleanFilter.register(); + SmudgeFilter.register(); } /**
diff --git a/org.eclipse.jgit.test/.classpath b/org.eclipse.jgit.test/.classpath index 8b81bf5..84b5052 100644 --- a/org.eclipse.jgit.test/.classpath +++ b/org.eclipse.jgit.test/.classpath
@@ -4,7 +4,7 @@ <classpathentry kind="src" path="src"/> <classpathentry kind="src" path="tst-rsrc"/> <classpathentry kind="src" path="exttst"/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> <classpathentry kind="output" path="bin"/> </classpath>
diff --git a/org.eclipse.jgit.test/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.test/.settings/org.eclipse.jdt.core.prefs index 87210fb..10c29d5 100644 --- a/org.eclipse.jgit.test/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.jgit.test/.settings/org.eclipse.jdt.core.prefs
@@ -7,9 +7,9 @@ org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate @@ -112,7 +112,7 @@ org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=error -org.eclipse.jdt.core.compiler.source=1.7 +org.eclipse.jdt.core.compiler.source=1.8 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
diff --git a/org.eclipse.jgit.test/BUCK b/org.eclipse.jgit.test/BUCK index 3df3336..e4cd47c 100644 --- a/org.eclipse.jgit.test/BUCK +++ b/org.eclipse.jgit.test/BUCK
@@ -60,6 +60,7 @@ ':tst_rsrc', '//org.eclipse.jgit:jgit', '//org.eclipse.jgit.junit:junit', + '//org.eclipse.jgit.lfs:jgit-lfs', '//lib:hamcrest-core', '//lib:hamcrest-library', '//lib:javaewah',
diff --git a/org.eclipse.jgit.test/META-INF/MANIFEST.MF b/org.eclipse.jgit.test/META-INF/MANIFEST.MF index 63fad8c..80d9e23 100644 --- a/org.eclipse.jgit.test/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.test/META-INF/MANIFEST.MF
@@ -2,52 +2,53 @@ Bundle-ManifestVersion: 2 Bundle-Name: %plugin_name Bundle-SymbolicName: org.eclipse.jgit.test -Bundle-Version: 4.5.1.qualifier +Bundle-Version: 4.6.0.qualifier Bundle-Localization: plugin Bundle-Vendor: %provider_name Bundle-ActivationPolicy: lazy -Bundle-RequiredExecutionEnvironment: JavaSE-1.7 +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: com.googlecode.javaewah;version="[0.7.9,0.8.0)", - org.eclipse.jgit.api;version="[4.5.1,4.6.0)", - org.eclipse.jgit.api.errors;version="[4.5.1,4.6.0)", - org.eclipse.jgit.attributes;version="[4.5.1,4.6.0)", - org.eclipse.jgit.awtui;version="[4.5.1,4.6.0)", - org.eclipse.jgit.blame;version="[4.5.1,4.6.0)", - org.eclipse.jgit.diff;version="[4.5.1,4.6.0)", - org.eclipse.jgit.dircache;version="[4.5.1,4.6.0)", - org.eclipse.jgit.errors;version="[4.5.1,4.6.0)", - org.eclipse.jgit.events;version="[4.5.1,4.6.0)", - org.eclipse.jgit.fnmatch;version="[4.5.1,4.6.0)", - org.eclipse.jgit.gitrepo;version="[4.5.1,4.6.0)", - org.eclipse.jgit.hooks;version="[4.5.1,4.6.0)", - org.eclipse.jgit.ignore;version="[4.5.1,4.6.0)", - org.eclipse.jgit.ignore.internal;version="[4.5.1,4.6.0)", - org.eclipse.jgit.internal;version="[4.5.1,4.6.0)", - org.eclipse.jgit.internal.storage.dfs;version="[4.5.1,4.6.0)", - org.eclipse.jgit.internal.storage.file;version="[4.5.1,4.6.0)", - org.eclipse.jgit.internal.storage.pack;version="[4.5.1,4.6.0)", - org.eclipse.jgit.internal.storage.reftree;version="[4.5.1,4.6.0)", - org.eclipse.jgit.junit;version="[4.5.1,4.6.0)", - org.eclipse.jgit.lib;version="[4.5.1,4.6.0)", - org.eclipse.jgit.merge;version="[4.5.1,4.6.0)", - org.eclipse.jgit.nls;version="[4.5.1,4.6.0)", - org.eclipse.jgit.notes;version="[4.5.1,4.6.0)", - org.eclipse.jgit.patch;version="[4.5.1,4.6.0)", - org.eclipse.jgit.pgm;version="[4.5.1,4.6.0)", - org.eclipse.jgit.pgm.internal;version="[4.5.1,4.6.0)", - org.eclipse.jgit.revplot;version="[4.5.1,4.6.0)", - org.eclipse.jgit.revwalk;version="[4.5.1,4.6.0)", - org.eclipse.jgit.revwalk.filter;version="[4.5.1,4.6.0)", - org.eclipse.jgit.storage.file;version="[4.5.1,4.6.0)", - org.eclipse.jgit.storage.pack;version="[4.5.1,4.6.0)", - org.eclipse.jgit.submodule;version="[4.5.1,4.6.0)", - org.eclipse.jgit.transport;version="[4.5.1,4.6.0)", - org.eclipse.jgit.transport.http;version="[4.5.1,4.6.0)", - org.eclipse.jgit.transport.resolver;version="[4.5.1,4.6.0)", - org.eclipse.jgit.treewalk;version="[4.5.1,4.6.0)", - org.eclipse.jgit.treewalk.filter;version="[4.5.1,4.6.0)", - org.eclipse.jgit.util;version="[4.5.1,4.6.0)", - org.eclipse.jgit.util.io;version="[4.5.1,4.6.0)", + org.eclipse.jgit.api;version="[4.6.0,4.7.0)", + org.eclipse.jgit.api.errors;version="[4.6.0,4.7.0)", + org.eclipse.jgit.attributes;version="[4.6.0,4.7.0)", + org.eclipse.jgit.awtui;version="[4.6.0,4.7.0)", + org.eclipse.jgit.blame;version="[4.6.0,4.7.0)", + org.eclipse.jgit.diff;version="[4.6.0,4.7.0)", + org.eclipse.jgit.dircache;version="[4.6.0,4.7.0)", + org.eclipse.jgit.errors;version="[4.6.0,4.7.0)", + org.eclipse.jgit.events;version="[4.6.0,4.7.0)", + org.eclipse.jgit.fnmatch;version="[4.6.0,4.7.0)", + org.eclipse.jgit.gitrepo;version="[4.6.0,4.7.0)", + org.eclipse.jgit.hooks;version="[4.6.0,4.7.0)", + org.eclipse.jgit.ignore;version="[4.6.0,4.7.0)", + org.eclipse.jgit.ignore.internal;version="[4.6.0,4.7.0)", + org.eclipse.jgit.internal;version="[4.6.0,4.7.0)", + org.eclipse.jgit.internal.storage.dfs;version="[4.6.0,4.7.0)", + org.eclipse.jgit.internal.storage.file;version="[4.6.0,4.7.0)", + org.eclipse.jgit.internal.storage.pack;version="[4.6.0,4.7.0)", + org.eclipse.jgit.internal.storage.reftree;version="[4.6.0,4.7.0)", + org.eclipse.jgit.junit;version="[4.6.0,4.7.0)", + org.eclipse.jgit.lfs;version="[4.6.0,4.7.0)", + org.eclipse.jgit.lib;version="[4.6.0,4.7.0)", + org.eclipse.jgit.merge;version="[4.6.0,4.7.0)", + org.eclipse.jgit.nls;version="[4.6.0,4.7.0)", + org.eclipse.jgit.notes;version="[4.6.0,4.7.0)", + org.eclipse.jgit.patch;version="[4.6.0,4.7.0)", + org.eclipse.jgit.pgm;version="[4.6.0,4.7.0)", + org.eclipse.jgit.pgm.internal;version="[4.6.0,4.7.0)", + org.eclipse.jgit.revplot;version="[4.6.0,4.7.0)", + org.eclipse.jgit.revwalk;version="[4.6.0,4.7.0)", + org.eclipse.jgit.revwalk.filter;version="[4.6.0,4.7.0)", + org.eclipse.jgit.storage.file;version="[4.6.0,4.7.0)", + org.eclipse.jgit.storage.pack;version="[4.6.0,4.7.0)", + org.eclipse.jgit.submodule;version="[4.6.0,4.7.0)", + org.eclipse.jgit.transport;version="[4.6.0,4.7.0)", + org.eclipse.jgit.transport.http;version="[4.6.0,4.7.0)", + org.eclipse.jgit.transport.resolver;version="[4.6.0,4.7.0)", + org.eclipse.jgit.treewalk;version="[4.6.0,4.7.0)", + org.eclipse.jgit.treewalk.filter;version="[4.6.0,4.7.0)", + org.eclipse.jgit.util;version="[4.6.0,4.7.0)", + org.eclipse.jgit.util.io;version="[4.6.0,4.7.0)", org.hamcrest;version="[1.1.0,2.0.0)", org.junit;version="[4.4.0,5.0.0)", org.junit.experimental.theories;version="[4.4.0,5.0.0)",
diff --git "a/org.eclipse.jgit.test/org.eclipse.jgit.core--All-External-Tests \050Java 6\051.launch" "b/org.eclipse.jgit.test/org.eclipse.jgit.core--All-External-Tests \050Java 6\051.launch" deleted file mode 100644 index db13a84..0000000 --- "a/org.eclipse.jgit.test/org.eclipse.jgit.core--All-External-Tests \050Java 6\051.launch" +++ /dev/null
@@ -1,21 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<launchConfiguration type="org.eclipse.jdt.junit.launchconfig"> -<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> -<listEntry value="/org.eclipse.jgit.test/exttst"/> -</listAttribute> -<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> -<listEntry value="2"/> -</listAttribute> -<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/> -<listAttribute key="org.eclipse.debug.ui.favoriteGroups"> -<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/> -<listEntry value="org.eclipse.debug.ui.launchGroup.run"/> -</listAttribute> -<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=org.eclipse.jgit.test/exttst"/> -<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/> -<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/> -<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/> -<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> -<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/> -<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.jgit.test"/> -</launchConfiguration>
diff --git a/org.eclipse.jgit.test/org.eclipse.jgit.core--All-External-Tests.launch b/org.eclipse.jgit.test/org.eclipse.jgit.core--All-External-Tests.launch deleted file mode 100644 index 2adb02c..0000000 --- a/org.eclipse.jgit.test/org.eclipse.jgit.core--All-External-Tests.launch +++ /dev/null
@@ -1,20 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<launchConfiguration type="org.eclipse.jdt.junit.launchconfig"> -<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> -<listEntry value="/org.eclipse.jgit.test/exttst"/> -</listAttribute> -<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> -<listEntry value="2"/> -</listAttribute> -<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/> -<listAttribute key="org.eclipse.debug.ui.favoriteGroups"> -<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/> -<listEntry value="org.eclipse.debug.ui.launchGroup.run"/> -</listAttribute> -<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=org.eclipse.jgit.test/exttst"/> -<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/> -<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/> -<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/> -<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/> -<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.jgit.test"/> -</launchConfiguration>
diff --git "a/org.eclipse.jgit.test/org.eclipse.jgit.core--All-Tests \050Java 6\051.launch" "b/org.eclipse.jgit.test/org.eclipse.jgit.core--All-Tests \050Java 6\051.launch" deleted file mode 100644 index f253d59..0000000 --- "a/org.eclipse.jgit.test/org.eclipse.jgit.core--All-Tests \050Java 6\051.launch" +++ /dev/null
@@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<launchConfiguration type="org.eclipse.jdt.junit.launchconfig"> -<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> -<listEntry value="/org.eclipse.jgit.test/tst"/> -</listAttribute> -<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> -<listEntry value="2"/> -</listAttribute> -<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/> -<listAttribute key="org.eclipse.debug.ui.favoriteGroups"> -<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/> -<listEntry value="org.eclipse.debug.ui.launchGroup.run"/> -</listAttribute> -<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=org.eclipse.jgit.test/tst"/> -<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/> -<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/> -<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/> -<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> -<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/> -<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.jgit.test"/> -<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx256m"/> -</launchConfiguration>
diff --git "a/org.eclipse.jgit.test/org.eclipse.jgit.core--All-Tests \050Java 7\051 \050de\051.launch" "b/org.eclipse.jgit.test/org.eclipse.jgit.core--All-Tests \050Java 7\051 \050de\051.launch" deleted file mode 100644 index 86446f9..0000000 --- "a/org.eclipse.jgit.test/org.eclipse.jgit.core--All-Tests \050Java 7\051 \050de\051.launch" +++ /dev/null
@@ -1,30 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<launchConfiguration type="org.eclipse.jdt.junit.launchconfig"> -<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> -<listEntry value="/org.eclipse.jgit.test/tst"/> -</listAttribute> -<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> -<listEntry value="2"/> -</listAttribute> -<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/> -<mapAttribute key="org.eclipse.debug.core.environmentVariables"> -<mapEntry key="LANG" value="de_DE.UTF-8"/> -</mapAttribute> -<listAttribute key="org.eclipse.debug.ui.favoriteGroups"> -<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/> -<listEntry value="org.eclipse.debug.ui.launchGroup.run"/> -</listAttribute> -<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=org.eclipse.jgit.test/tst"/> -<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/> -<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/> -<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/> -<listAttribute key="org.eclipse.jdt.launching.CLASSPATH"> -<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6" path="1" type="4"/> "/> -<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry id="org.eclipse.jdt.launching.classpathentry.defaultClasspath"> <memento exportedEntriesOnly="false" project="org.eclipse.jgit.test"/> </runtimeClasspathEntry> "/> -</listAttribute> -<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/> -<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/> -<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/> -<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.jgit.test"/> -<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx256m"/> -</launchConfiguration>
diff --git "a/org.eclipse.jgit.test/org.eclipse.jgit.core--All-Tests \050Java 7\051.launch" "b/org.eclipse.jgit.test/org.eclipse.jgit.core--All-Tests \050Java 7\051.launch" deleted file mode 100644 index a83fabb..0000000 --- "a/org.eclipse.jgit.test/org.eclipse.jgit.core--All-Tests \050Java 7\051.launch" +++ /dev/null
@@ -1,27 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<launchConfiguration type="org.eclipse.jdt.junit.launchconfig"> -<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> -<listEntry value="/org.eclipse.jgit.test/tst"/> -</listAttribute> -<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> -<listEntry value="2"/> -</listAttribute> -<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/> -<listAttribute key="org.eclipse.debug.ui.favoriteGroups"> -<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/> -<listEntry value="org.eclipse.debug.ui.launchGroup.run"/> -</listAttribute> -<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=org.eclipse.jgit.test/tst"/> -<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/> -<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/> -<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/> -<listAttribute key="org.eclipse.jdt.launching.CLASSPATH"> -<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6" path="1" type="4"/> "/> -<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry id="org.eclipse.jdt.launching.classpathentry.defaultClasspath"> <memento exportedEntriesOnly="false" project="org.eclipse.jgit.test"/> </runtimeClasspathEntry> "/> -</listAttribute> -<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/> -<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/> -<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/> -<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.jgit.test"/> -<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx256m"/> -</launchConfiguration>
diff --git a/org.eclipse.jgit.test/pom.xml b/org.eclipse.jgit.test/pom.xml index da7d86f..5c358b1 100644 --- a/org.eclipse.jgit.test/pom.xml +++ b/org.eclipse.jgit.test/pom.xml
@@ -52,7 +52,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit-parent</artifactId> - <version>4.5.1-SNAPSHOT</version> + <version>4.6.0-SNAPSHOT</version> </parent> <artifactId>org.eclipse.jgit.test</artifactId>
diff --git a/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/indexdiff/filerepo.txt b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/indexdiff/filerepo.txt new file mode 100644 index 0000000..3255efb --- /dev/null +++ b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/indexdiff/filerepo.txt
@@ -0,0 +1,30 @@ +blob +mark :1 +data 10 +äéü.txt +blob +mark :2 +data 8 +test.txt +blob +mark :3 +data 5 +Test + +blob +mark :4 +data 7 +äéü + +reset refs/heads/master +commit refs/heads/master +mark :5 +author A U Thor <author@example.com> 1450727513 +0100 +committer A U Thor <author@example.com> 1450727513 +0100 +data 26 +Initial commit with links +M 120000 :1 testfolder/aeu.txt +M 120000 :2 testfolder/link.txt +M 100644 :3 testfolder/test.txt +M 100644 :4 testfolder/äéü.txt +
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/AddCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/AddCommandTest.java index 42601aa..5ad73f1 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/AddCommandTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/AddCommandTest.java
@@ -57,12 +57,21 @@ import org.eclipse.jgit.api.errors.FilterFailedException; import org.eclipse.jgit.api.errors.GitAPIException; import org.eclipse.jgit.api.errors.NoFilepatternException; +import org.eclipse.jgit.attributes.FilterCommandRegistry; import org.eclipse.jgit.dircache.DirCache; import org.eclipse.jgit.dircache.DirCacheBuilder; import org.eclipse.jgit.dircache.DirCacheEntry; import org.eclipse.jgit.junit.JGitTestUtil; import org.eclipse.jgit.junit.RepositoryTestCase; -import org.eclipse.jgit.lib.*; +import org.eclipse.jgit.lfs.CleanFilter; +import org.eclipse.jgit.lfs.SmudgeFilter; +import org.eclipse.jgit.lib.ConfigConstants; +import org.eclipse.jgit.lib.Constants; +import org.eclipse.jgit.lib.FileMode; +import org.eclipse.jgit.lib.ObjectId; +import org.eclipse.jgit.lib.ObjectInserter; +import org.eclipse.jgit.lib.Repository; +import org.eclipse.jgit.lib.StoredConfig; import org.eclipse.jgit.revwalk.RevCommit; import org.eclipse.jgit.storage.file.FileRepositoryBuilder; import org.eclipse.jgit.treewalk.TreeWalk; @@ -70,8 +79,23 @@ import org.eclipse.jgit.util.FS; import org.eclipse.jgit.util.FileUtils; import org.junit.Test; +import org.junit.experimental.theories.DataPoints; +import org.junit.experimental.theories.Theories; +import org.junit.experimental.theories.Theory; +import org.junit.runner.RunWith; +@RunWith(Theories.class) public class AddCommandTest extends RepositoryTestCase { + @DataPoints + public static boolean[] sleepBeforeAddOptions = { true, false }; + + + @Override + public void setUp() throws Exception { + CleanFilter.register(); + SmudgeFilter.register(); + super.setUp(); + } @Test public void testAddNothing() throws GitAPIException { @@ -110,8 +134,7 @@ public void testAddExistingSingleFile() throws IOException, GitAPIException { } @Test - public void testCleanFilter() throws IOException, - GitAPIException { + public void testCleanFilter() throws IOException, GitAPIException { writeTrashFile(".gitattributes", "*.txt filter=tstFilter"); writeTrashFile("src/a.tmp", "foo"); // Caution: we need a trailing '\n' since sed on mac always appends @@ -134,6 +157,128 @@ public void testCleanFilter() throws IOException, } } + @Theory + public void testBuiltinFilters(boolean sleepBeforeAdd) + throws IOException, + GitAPIException, InterruptedException { + writeTrashFile(".gitattributes", "*.txt filter=lfs"); + writeTrashFile("src/a.tmp", "foo"); + // Caution: we need a trailing '\n' since sed on mac always appends + // linefeeds if missing + File script = writeTempFile("sed s/o/e/g"); + File f = writeTrashFile("src/a.txt", "foo\n"); + + try (Git git = new Git(db)) { + if (!sleepBeforeAdd) { + fsTick(f); + } + git.add().addFilepattern(".gitattributes").call(); + StoredConfig config = git.getRepository().getConfig(); + config.setString("filter", "lfs", "clean", + "sh " + slashify(script.getPath())); + config.setString("filter", "lfs", "smudge", + "sh " + slashify(script.getPath())); + config.setBoolean("filter", "lfs", "useJGitBuiltin", true); + config.save(); + + if (!sleepBeforeAdd) { + fsTick(f); + } + git.add().addFilepattern("src/a.txt").addFilepattern("src/a.tmp") + .addFilepattern(".gitattributes").call(); + + assertEquals( + "[.gitattributes, mode:100644, content:*.txt filter=lfs][src/a.tmp, mode:100644, content:foo][src/a.txt, mode:100644, content:version https://git-lfs.github.com/spec/v1\noid sha256:b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c\nsize 4\n]", + indexState(CONTENT)); + + RevCommit c1 = git.commit().setMessage("c1").call(); + assertTrue(git.status().call().isClean()); + f = writeTrashFile("src/a.txt", "foobar\n"); + if (!sleepBeforeAdd) { + fsTick(f); + } + git.add().addFilepattern("src/a.txt").call(); + git.commit().setMessage("c2").call(); + assertTrue(git.status().call().isClean()); + assertEquals( + "[.gitattributes, mode:100644, content:*.txt filter=lfs][src/a.tmp, mode:100644, content:foo][src/a.txt, mode:100644, content:version https://git-lfs.github.com/spec/v1\noid sha256:aec070645fe53ee3b3763059376134f058cc337247c978add178b6ccdfb0019f\nsize 7\n]", + indexState(CONTENT)); + assertEquals("foobar\n", read("src/a.txt")); + git.checkout().setName(c1.getName()).call(); + assertEquals( + "[.gitattributes, mode:100644, content:*.txt filter=lfs][src/a.tmp, mode:100644, content:foo][src/a.txt, mode:100644, content:version https://git-lfs.github.com/spec/v1\noid sha256:b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c\nsize 4\n]", + indexState(CONTENT)); + assertEquals( + "foo\n", read("src/a.txt")); + } + } + + @Theory + public void testBuiltinCleanFilter(boolean sleepBeforeAdd) + throws IOException, GitAPIException, InterruptedException { + writeTrashFile(".gitattributes", "*.txt filter=lfs"); + writeTrashFile("src/a.tmp", "foo"); + // Caution: we need a trailing '\n' since sed on mac always appends + // linefeeds if missing + File script = writeTempFile("sed s/o/e/g"); + File f = writeTrashFile("src/a.txt", "foo\n"); + + // unregister the smudge filter. Only clean filter should be builtin + FilterCommandRegistry.unregister( + org.eclipse.jgit.lib.Constants.BUILTIN_FILTER_PREFIX + + "lfs/smudge"); + + try (Git git = new Git(db)) { + if (!sleepBeforeAdd) { + fsTick(f); + } + git.add().addFilepattern(".gitattributes").call(); + StoredConfig config = git.getRepository().getConfig(); + config.setString("filter", "lfs", "clean", + "sh " + slashify(script.getPath())); + config.setString("filter", "lfs", "smudge", + "sh " + slashify(script.getPath())); + config.setBoolean("filter", "lfs", "useJGitBuiltin", true); + config.save(); + + if (!sleepBeforeAdd) { + fsTick(f); + } + git.add().addFilepattern("src/a.txt").addFilepattern("src/a.tmp") + .addFilepattern(".gitattributes").call(); + + assertEquals( + "[.gitattributes, mode:100644, content:*.txt filter=lfs][src/a.tmp, mode:100644, content:foo][src/a.txt, mode:100644, content:version https://git-lfs.github.com/spec/v1\noid sha256:b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c\nsize 4\n]", + indexState(CONTENT)); + + RevCommit c1 = git.commit().setMessage("c1").call(); + assertTrue(git.status().call().isClean()); + f = writeTrashFile("src/a.txt", "foobar\n"); + if (!sleepBeforeAdd) { + fsTick(f); + } + git.add().addFilepattern("src/a.txt").call(); + git.commit().setMessage("c2").call(); + assertTrue(git.status().call().isClean()); + assertEquals( + "[.gitattributes, mode:100644, content:*.txt filter=lfs][src/a.tmp, mode:100644, content:foo][src/a.txt, mode:100644, content:version https://git-lfs.github.com/spec/v1\noid sha256:aec070645fe53ee3b3763059376134f058cc337247c978add178b6ccdfb0019f\nsize 7\n]", + indexState(CONTENT)); + assertEquals("foobar\n", read("src/a.txt")); + git.checkout().setName(c1.getName()).call(); + assertEquals( + "[.gitattributes, mode:100644, content:*.txt filter=lfs][src/a.tmp, mode:100644, content:foo][src/a.txt, mode:100644, content:version https://git-lfs.github.com/spec/v1\noid sha256:b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c\nsize 4\n]", + indexState(CONTENT)); + // due to lfs clean filter but dummy smudge filter we expect strange + // content. The smudge filter converts from real content to pointer + // file content (starting with "version ") but the smudge filter + // replaces 'o' by 'e' which results in a text starting with + // "versien " + assertEquals( + "versien https://git-lfs.github.cem/spec/v1\neid sha256:b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c\nsize 4\n", + read("src/a.txt")); + } + } + @Test public void testAttributesWithTreeWalkFilter() throws IOException, GitAPIException {
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CheckoutCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CheckoutCommandTest.java index 0bb6610..3c19672 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CheckoutCommandTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CheckoutCommandTest.java
@@ -74,6 +74,8 @@ import org.eclipse.jgit.dircache.DirCacheEntry; import org.eclipse.jgit.junit.JGitTestUtil; import org.eclipse.jgit.junit.RepositoryTestCase; +import org.eclipse.jgit.lfs.CleanFilter; +import org.eclipse.jgit.lfs.SmudgeFilter; import org.eclipse.jgit.lib.ConfigConstants; import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.lib.Ref; @@ -87,6 +89,7 @@ import org.eclipse.jgit.transport.RemoteConfig; import org.eclipse.jgit.transport.URIish; import org.eclipse.jgit.util.FileUtils; +import org.eclipse.jgit.util.SystemReader; import org.junit.Before; import org.junit.Test; @@ -100,6 +103,8 @@ public class CheckoutCommandTest extends RepositoryTestCase { @Override @Before public void setUp() throws Exception { + CleanFilter.register(); + SmudgeFilter.register(); super.setUp(); git = new Git(db); // commit something @@ -563,11 +568,11 @@ public void testCheckoutAutoCrlfTrue() throws Exception { public void testSmudgeFilter_modifyExisting() throws IOException, GitAPIException { File script = writeTempFile("sed s/o/e/g"); StoredConfig config = git.getRepository().getConfig(); - config.setString("filter", "tstFilter", "smudge", + config.setString("filter", "lfs", "smudge", "sh " + slashify(script.getPath())); config.save(); - writeTrashFile(".gitattributes", "*.txt filter=tstFilter"); + writeTrashFile(".gitattributes", "*.txt filter=lfs"); git.add().addFilepattern(".gitattributes").call(); git.commit().setMessage("add filter").call(); @@ -589,7 +594,7 @@ public void testSmudgeFilter_modifyExisting() throws IOException, GitAPIExceptio git.checkout().setName(content2.getName()).call(); assertEquals( - "[.gitattributes, mode:100644, content:*.txt filter=tstFilter][Test.txt, mode:100644, content:Some change][src/a.tmp, mode:100644, content:foo][src/a.txt, mode:100644, content:foo\n]", + "[.gitattributes, mode:100644, content:*.txt filter=lfs][Test.txt, mode:100644, content:Some change][src/a.tmp, mode:100644, content:foo][src/a.txt, mode:100644, content:foo\n]", indexState(CONTENT)); assertEquals(Sets.of("src/a.txt"), git.status().call().getModified()); assertEquals("foo", read("src/a.tmp")); @@ -601,7 +606,7 @@ public void testSmudgeFilter_createNew() throws IOException, GitAPIException { File script = writeTempFile("sed s/o/e/g"); StoredConfig config = git.getRepository().getConfig(); - config.setString("filter", "tstFilter", "smudge", + config.setString("filter", "lfs", "smudge", "sh " + slashify(script.getPath())); config.save(); @@ -609,7 +614,7 @@ public void testSmudgeFilter_createNew() git.add().addFilepattern("foo").call(); RevCommit initial = git.commit().setMessage("initial").call(); - writeTrashFile(".gitattributes", "*.txt filter=tstFilter"); + writeTrashFile(".gitattributes", "*.txt filter=lfs"); git.add().addFilepattern(".gitattributes").call(); git.commit().setMessage("add filter").call(); @@ -625,7 +630,7 @@ public void testSmudgeFilter_createNew() git.checkout().setName(content.getName()).call(); assertEquals( - "[.gitattributes, mode:100644, content:*.txt filter=tstFilter][Test.txt, mode:100644, content:Some change][foo, mode:100644, content:foo][src/a.tmp, mode:100644, content:foo][src/a.txt, mode:100644, content:foo\n]", + "[.gitattributes, mode:100644, content:*.txt filter=lfs][Test.txt, mode:100644, content:Some change][foo, mode:100644, content:foo][src/a.tmp, mode:100644, content:foo][src/a.txt, mode:100644, content:foo\n]", indexState(CONTENT)); assertEquals("foo", read("src/a.tmp")); assertEquals("fee\n", read("src/a.txt")); @@ -636,7 +641,7 @@ public void testSmudgeFilter_deleteFileAndRestoreFromCommit() throws IOException, GitAPIException { File script = writeTempFile("sed s/o/e/g"); StoredConfig config = git.getRepository().getConfig(); - config.setString("filter", "tstFilter", "smudge", + config.setString("filter", "lfs", "smudge", "sh " + slashify(script.getPath())); config.save(); @@ -644,7 +649,7 @@ public void testSmudgeFilter_deleteFileAndRestoreFromCommit() git.add().addFilepattern("foo").call(); git.commit().setMessage("initial").call(); - writeTrashFile(".gitattributes", "*.txt filter=tstFilter"); + writeTrashFile(".gitattributes", "*.txt filter=lfs"); git.add().addFilepattern(".gitattributes").call(); git.commit().setMessage("add filter").call(); @@ -661,7 +666,7 @@ public void testSmudgeFilter_deleteFileAndRestoreFromCommit() .call(); assertEquals( - "[.gitattributes, mode:100644, content:*.txt filter=tstFilter][Test.txt, mode:100644, content:Some change][foo, mode:100644, content:foo][src/a.tmp, mode:100644, content:foo][src/a.txt, mode:100644, content:foo\n]", + "[.gitattributes, mode:100644, content:*.txt filter=lfs][Test.txt, mode:100644, content:Some change][foo, mode:100644, content:foo][src/a.tmp, mode:100644, content:foo][src/a.txt, mode:100644, content:foo\n]", indexState(CONTENT)); assertEquals("foo", read("src/a.tmp")); assertEquals("fee\n", read("src/a.txt")); @@ -672,7 +677,7 @@ public void testSmudgeFilter_deleteFileAndRestoreFromIndex() throws IOException, GitAPIException { File script = writeTempFile("sed s/o/e/g"); StoredConfig config = git.getRepository().getConfig(); - config.setString("filter", "tstFilter", "smudge", + config.setString("filter", "lfs", "smudge", "sh " + slashify(script.getPath())); config.save(); @@ -680,7 +685,7 @@ public void testSmudgeFilter_deleteFileAndRestoreFromIndex() git.add().addFilepattern("foo").call(); git.commit().setMessage("initial").call(); - writeTrashFile(".gitattributes", "*.txt filter=tstFilter"); + writeTrashFile(".gitattributes", "*.txt filter=lfs"); git.add().addFilepattern(".gitattributes").call(); git.commit().setMessage("add filter").call(); @@ -696,7 +701,7 @@ public void testSmudgeFilter_deleteFileAndRestoreFromIndex() git.checkout().addPath("src/a.txt").call(); assertEquals( - "[.gitattributes, mode:100644, content:*.txt filter=tstFilter][Test.txt, mode:100644, content:Some change][foo, mode:100644, content:foo][src/a.tmp, mode:100644, content:foo][src/a.txt, mode:100644, content:foo\n]", + "[.gitattributes, mode:100644, content:*.txt filter=lfs][Test.txt, mode:100644, content:Some change][foo, mode:100644, content:foo][src/a.tmp, mode:100644, content:foo][src/a.txt, mode:100644, content:foo\n]", indexState(CONTENT)); assertEquals("foo", read("src/a.tmp")); assertEquals("fee\n", read("src/a.txt")); @@ -707,7 +712,7 @@ public void testSmudgeFilter_deleteFileAndCreateBranchAndRestoreFromCommit() throws IOException, GitAPIException { File script = writeTempFile("sed s/o/e/g"); StoredConfig config = git.getRepository().getConfig(); - config.setString("filter", "tstFilter", "smudge", + config.setString("filter", "lfs", "smudge", "sh " + slashify(script.getPath())); config.save(); @@ -715,7 +720,7 @@ public void testSmudgeFilter_deleteFileAndCreateBranchAndRestoreFromCommit() git.add().addFilepattern("foo").call(); git.commit().setMessage("initial").call(); - writeTrashFile(".gitattributes", "*.txt filter=tstFilter"); + writeTrashFile(".gitattributes", "*.txt filter=lfs"); git.add().addFilepattern(".gitattributes").call(); git.commit().setMessage("add filter").call(); @@ -732,7 +737,7 @@ public void testSmudgeFilter_deleteFileAndCreateBranchAndRestoreFromCommit() .setStartPoint(content).addPath("src/a.txt").call(); assertEquals( - "[.gitattributes, mode:100644, content:*.txt filter=tstFilter][Test.txt, mode:100644, content:Some change][foo, mode:100644, content:foo][src/a.tmp, mode:100644, content:foo][src/a.txt, mode:100644, content:foo\n]", + "[.gitattributes, mode:100644, content:*.txt filter=lfs][Test.txt, mode:100644, content:Some change][foo, mode:100644, content:foo][src/a.tmp, mode:100644, content:foo][src/a.txt, mode:100644, content:foo\n]", indexState(CONTENT)); assertEquals("foo", read("src/a.tmp")); assertEquals("fee\n", read("src/a.txt")); @@ -745,12 +750,13 @@ public void testSmudgeAndClean() throws Exception { try (Git git2 = new Git(db)) { StoredConfig config = git.getRepository().getConfig(); - config.setString("filter", "tstFilter", "smudge", + config.setString("filter", "lfs", "smudge", "sh " + slashify(smudge_filter.getPath())); - config.setString("filter", "tstFilter", "clean", + config.setString("filter", "lfs", "clean", "sh " + slashify(clean_filter.getPath())); + config.setBoolean("filter", "lfs", "useJGitBuiltin", true); config.save(); - writeTrashFile(".gitattributes", "filterTest.txt filter=tstFilter"); + writeTrashFile(".gitattributes", "filterTest.txt filter=lfs"); git2.add().addFilepattern(".gitattributes").call(); git2.commit().setMessage("add attributes").call(); @@ -758,7 +764,7 @@ public void testSmudgeAndClean() throws Exception { git2.add().addFilepattern("filterTest.txt").call(); RevCommit one = git2.commit().setMessage("add filterText.txt").call(); assertEquals( - "[.gitattributes, mode:100644, content:filterTest.txt filter=tstFilter][Test.txt, mode:100644, content:Some change][filterTest.txt, mode:100644, content:hello world, @version\n]", + "[.gitattributes, mode:100644, content:filterTest.txt filter=lfs][Test.txt, mode:100644, content:Some change][filterTest.txt, mode:100644, content:version https://git-lfs.github.com/spec/v1\noid sha256:7bd5d32e5c494354aa4c2473a1306d0ce7b52cc3bffeb342c03cd517ef8cf8da\nsize 16\n]", indexState(CONTENT)); fsTick(writeTrashFile("filterTest.txt", "bon giorno world, V1\n")); @@ -767,25 +773,57 @@ public void testSmudgeAndClean() throws Exception { assertTrue(git2.status().call().isClean()); assertEquals( - "[.gitattributes, mode:100644, content:filterTest.txt filter=tstFilter][Test.txt, mode:100644, content:Some change][filterTest.txt, mode:100644, content:bon giorno world, @version\n]", + "[.gitattributes, mode:100644, content:filterTest.txt filter=lfs][Test.txt, mode:100644, content:Some change][filterTest.txt, mode:100644, content:version https://git-lfs.github.com/spec/v1\noid sha256:087148cccf53b0049c56475c1595113c9da4b638997c3489af8ac7108d51ef13\nsize 21\n]", indexState(CONTENT)); git2.checkout().setName(one.getName()).call(); assertTrue(git2.status().call().isClean()); assertEquals( - "[.gitattributes, mode:100644, content:filterTest.txt filter=tstFilter][Test.txt, mode:100644, content:Some change][filterTest.txt, mode:100644, content:hello world, @version\n]", + "[.gitattributes, mode:100644, content:filterTest.txt filter=lfs][Test.txt, mode:100644, content:Some change][filterTest.txt, mode:100644, content:version https://git-lfs.github.com/spec/v1\noid sha256:7bd5d32e5c494354aa4c2473a1306d0ce7b52cc3bffeb342c03cd517ef8cf8da\nsize 16\n]", indexState(CONTENT)); assertEquals("hello world, V1\n", read("filterTest.txt")); git2.checkout().setName(two.getName()).call(); assertTrue(git2.status().call().isClean()); assertEquals( - "[.gitattributes, mode:100644, content:filterTest.txt filter=tstFilter][Test.txt, mode:100644, content:Some change][filterTest.txt, mode:100644, content:bon giorno world, @version\n]", + "[.gitattributes, mode:100644, content:filterTest.txt filter=lfs][Test.txt, mode:100644, content:Some change][filterTest.txt, mode:100644, content:version https://git-lfs.github.com/spec/v1\noid sha256:087148cccf53b0049c56475c1595113c9da4b638997c3489af8ac7108d51ef13\nsize 21\n]", indexState(CONTENT)); assertEquals("bon giorno world, V1\n", read("filterTest.txt")); } } + @Test + public void testNonDeletableFilesOnWindows() + throws GitAPIException, IOException { + // Only on windows a FileInputStream blocks us from deleting a file + org.junit.Assume.assumeTrue(SystemReader.getInstance().isWindows()); + writeTrashFile("toBeModified.txt", "a"); + writeTrashFile("toBeDeleted.txt", "a"); + git.add().addFilepattern(".").call(); + RevCommit addFiles = git.commit().setMessage("add more files").call(); + + git.rm().setCached(false).addFilepattern("Test.txt") + .addFilepattern("toBeDeleted.txt").call(); + writeTrashFile("toBeModified.txt", "b"); + writeTrashFile("toBeCreated.txt", "a"); + git.add().addFilepattern(".").call(); + RevCommit crudCommit = git.commit().setMessage("delete, modify, add") + .call(); + git.checkout().setName(addFiles.getName()).call(); + try ( FileInputStream fis=new FileInputStream(new File(db.getWorkTree(), "Test.txt")) ) { + CheckoutCommand coCommand = git.checkout(); + coCommand.setName(crudCommit.getName()).call(); + CheckoutResult result = coCommand.getResult(); + assertEquals(Status.NONDELETED, result.getStatus()); + assertEquals("[Test.txt, toBeDeleted.txt]", + result.getRemovedList().toString()); + assertEquals("[toBeCreated.txt, toBeModified.txt]", + result.getModifiedList().toString()); + assertEquals("[Test.txt]", result.getUndeletedList().toString()); + assertTrue(result.getConflictList().isEmpty()); + } + } + private File writeTempFile(String body) throws IOException { File f = File.createTempFile("AddCommandTest_", ""); JGitTestUtil.write(f, body);
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/indexdiff/IndexDiffWithSymlinkTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/indexdiff/IndexDiffWithSymlinkTest.java new file mode 100644 index 0000000..4f3b601 --- /dev/null +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/indexdiff/IndexDiffWithSymlinkTest.java
@@ -0,0 +1,234 @@ +/* + * Copyright (C) 2015 Thomas Wolf <thomas.wolf@paranor.ch> + * + * This program and the accompanying materials are made available + * under the terms of the Eclipse Distribution License v1.0 which + * accompanies this distribution, is reproduced below, and is + * available at http://www.eclipse.org/org/documents/edl-v10.php + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * + * - Neither the name of the Eclipse Foundation, Inc. nor the + * names of its contributors may be used to endorse or promote + * products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.eclipse.jgit.indexdiff; + +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; +import static org.junit.Assume.assumeTrue; + +import java.io.BufferedOutputStream; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.Writer; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.Collections; + +import org.eclipse.jgit.junit.LocalDiskRepositoryTestCase; +import org.eclipse.jgit.lib.Constants; +import org.eclipse.jgit.lib.IndexDiff; +import org.eclipse.jgit.lib.Repository; +import org.eclipse.jgit.storage.file.FileRepositoryBuilder; +import org.eclipse.jgit.treewalk.FileTreeIterator; +import org.eclipse.jgit.treewalk.WorkingTreeIterator; +import org.eclipse.jgit.treewalk.filter.PathFilterGroup; +import org.eclipse.jgit.util.FS; +import org.eclipse.jgit.util.SystemReader; +import org.junit.Before; +import org.junit.Test; + +/** + * MacOS-only test for dealing with symlinks in IndexDiff. Recreates using cgit + * a test repository prepared with git 2.2.1 on MacOS 10.7.5 containing some + * symlinks. Examines a symlink pointing to a file named "äéü.txt" (should be + * encoded as UTF-8 NFC), changes it through Java, examines it again to verify + * it's been changed to UTF-8 NFD, and finally calculates an IndexDiff. + */ +public class IndexDiffWithSymlinkTest extends LocalDiskRepositoryTestCase { + + private static final String FILEREPO = "filerepo"; + + private static final String TESTFOLDER = "testfolder"; + + private static final String TESTTARGET = "äéü.txt"; + + private static final String TESTLINK = "aeu.txt"; + + private static final byte[] NFC = // "äéü.txt" in NFC + { -61, -92, -61, -87, -61, -68, 46, 116, 120, 116 }; + + private static final byte[] NFD = // "äéü.txt" in NFD + { 97, -52, -120, 101, -52, -127, 117, -52, -120, 46, 116, 120, 116 }; + + private File testRepoDir; + + @Override + @Before + public void setUp() throws Exception { + assumeTrue(SystemReader.getInstance().isMacOS() + && FS.DETECTED.supportsSymlinks()); + super.setUp(); + File testDir = createTempDirectory(this.getClass().getSimpleName()); + InputStream in = this.getClass().getClassLoader().getResourceAsStream( + this.getClass().getPackage().getName().replace('.', '/') + '/' + + FILEREPO + ".txt"); + assertNotNull("Test repo file not found", in); + try { + testRepoDir = restoreGitRepo(in, testDir, FILEREPO); + } finally { + in.close(); + } + } + + private File restoreGitRepo(InputStream in, File testDir, String name) + throws Exception { + File exportedTestRepo = new File(testDir, name + ".txt"); + copy(in, exportedTestRepo); + // Use CGit to restore + File restoreScript = new File(testDir, name + ".sh"); + try (OutputStream out = new BufferedOutputStream( + new FileOutputStream(restoreScript)); + Writer writer = new OutputStreamWriter(out, + StandardCharsets.UTF_8)) { + writer.write("echo `which git` 1>&2\n"); + writer.write("echo `git --version` 1>&2\n"); + writer.write("git init " + name + " && \\\n"); + writer.write("cd ./" + name + " && \\\n"); + writer.write("git fast-import < ../" + name + ".txt && \\\n"); + writer.write("git checkout -f\n"); + } + String[] cmd = { "/bin/sh", "./" + name + ".sh" }; + int exitCode; + String stdErr; + Process process = Runtime.getRuntime().exec(cmd, null, testDir); + try (InputStream stdOutStream = process.getInputStream(); + InputStream stdErrStream = process.getErrorStream(); + OutputStream stdInStream = process.getOutputStream()) { + readStream(stdOutStream); + stdErr = readStream(stdErrStream); + process.waitFor(); + exitCode = process.exitValue(); + } + if (exitCode != 0) { + fail("cgit repo restore returned " + exitCode + '\n' + stdErr); + } + return new File(new File(testDir, name), Constants.DOT_GIT); + } + + private void copy(InputStream from, File to) throws IOException { + try (OutputStream out = new FileOutputStream(to)) { + byte[] buffer = new byte[4096]; + int n; + while ((n = from.read(buffer)) > 0) { + out.write(buffer, 0, n); + } + } + } + + private String readStream(InputStream stream) throws IOException { + try (BufferedReader in = new BufferedReader( + new InputStreamReader(stream))) { + StringBuilder out = new StringBuilder(); + String line; + while ((line = in.readLine()) != null) { + out.append(line).append('\n'); + } + return out.toString(); + } + } + + @Test + public void testSymlinkWithEncodingDifference() throws Exception { + try (Repository testRepo = FileRepositoryBuilder.create(testRepoDir)) { + File workingTree = testRepo.getWorkTree(); + File symLink = new File(new File(workingTree, TESTFOLDER), + TESTLINK); + // Read the symlink as it was created by cgit + Path linkTarget = Files.readSymbolicLink(symLink.toPath()); + assertEquals("Unexpected link target", TESTTARGET, + linkTarget.toString()); + byte[] raw = rawPath(linkTarget); + if (raw != null) { + assertArrayEquals("Expected an NFC link target", NFC, raw); + } + // Now re-create that symlink through Java + assertTrue("Could not delete symlink", symLink.delete()); + Files.createSymbolicLink(symLink.toPath(), Paths.get(TESTTARGET)); + // Read it again + linkTarget = Files.readSymbolicLink(symLink.toPath()); + assertEquals("Unexpected link target", TESTTARGET, + linkTarget.toString()); + raw = rawPath(linkTarget); + if (raw != null) { + assertArrayEquals("Expected an NFD link target", NFD, raw); + } + // Do the indexdiff + WorkingTreeIterator iterator = new FileTreeIterator(testRepo); + IndexDiff diff = new IndexDiff(testRepo, Constants.HEAD, iterator); + diff.setFilter(PathFilterGroup.createFromStrings( + Collections.singleton(TESTFOLDER + '/' + TESTLINK))); + diff.diff(); + // We're testing that this does NOT throw "EOFException: Short read + // of block." The diff will not report any modified files -- the + // link modification is not visible to JGit, which always works with + // the Java internal NFC encoding. CGit does report the link as an + // unstaged modification here, though. + } + } + + private byte[] rawPath(Path p) { + try { + Method method = p.getClass().getDeclaredMethod("asByteArray"); + if (method != null) { + method.setAccessible(true); + return (byte[]) method.invoke(p); + } + } catch (NoSuchMethodException | IllegalAccessException + | IllegalArgumentException | InvocationTargetException e) { + // Ignore and fall through. + } + return null; + } +}
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/FilterCommandsTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/FilterCommandsTest.java new file mode 100644 index 0000000..0d31811 --- /dev/null +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/FilterCommandsTest.java
@@ -0,0 +1,251 @@ +/* + * Copyright (C) 2016, Christian Halstrick <christian.halstrick@sap.com> + * and other copyright owners as documented in the project's IP log. + * + * This program and the accompanying materials are made available + * under the terms of the Eclipse Distribution License v1.0 which + * accompanies this distribution, is reproduced below, and is + * available at http://www.eclipse.org/org/documents/edl-v10.php + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * + * - Neither the name of the Eclipse Foundation, Inc. nor the + * names of its contributors may be used to endorse or promote + * products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.eclipse.jgit.util; + +import static org.junit.Assert.assertEquals; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; + +import org.eclipse.jgit.api.Git; +import org.eclipse.jgit.api.errors.GitAPIException; +import org.eclipse.jgit.attributes.FilterCommand; +import org.eclipse.jgit.attributes.FilterCommandFactory; +import org.eclipse.jgit.attributes.FilterCommandRegistry; +import org.eclipse.jgit.junit.RepositoryTestCase; +import org.eclipse.jgit.lib.Constants; +import org.eclipse.jgit.lib.RefUpdate; +import org.eclipse.jgit.lib.Repository; +import org.eclipse.jgit.lib.StoredConfig; +import org.eclipse.jgit.revwalk.RevCommit; +import org.junit.Before; +import org.junit.Test; + +public class FilterCommandsTest extends RepositoryTestCase { + private Git git; + + RevCommit initialCommit; + + RevCommit secondCommit; + + class TestCommandFactory implements FilterCommandFactory { + private int prefix; + + public TestCommandFactory(int prefix) { + this.prefix = prefix; + } + + @Override + public FilterCommand create(Repository repo, InputStream in, + final OutputStream out) { + FilterCommand cmd = new FilterCommand(in, out) { + + @Override + public int run() throws IOException { + int b = in.read(); + if (b == -1) { + return b; + } + out.write(prefix); + out.write(b); + return 1; + } + }; + return cmd; + } + } + + @Override + @Before + public void setUp() throws Exception { + super.setUp(); + git = new Git(db); + // commit something + writeTrashFile("Test.txt", "Hello world"); + git.add().addFilepattern("Test.txt").call(); + initialCommit = git.commit().setMessage("Initial commit").call(); + + // create a master branch and switch to it + git.branchCreate().setName("test").call(); + RefUpdate rup = db.updateRef(Constants.HEAD); + rup.link("refs/heads/test"); + + // commit something on the test branch + writeTrashFile("Test.txt", "Some change"); + git.add().addFilepattern("Test.txt").call(); + secondCommit = git.commit().setMessage("Second commit").call(); + } + + @Test + public void testBuiltinCleanFilter() + throws IOException, GitAPIException { + String builtinCommandName = "jgit://builtin/test/clean"; + FilterCommandRegistry.register(builtinCommandName, + new TestCommandFactory('c')); + StoredConfig config = git.getRepository().getConfig(); + config.setString("filter", "test", "clean", builtinCommandName); + config.save(); + + writeTrashFile(".gitattributes", "*.txt filter=test"); + git.add().addFilepattern(".gitattributes").call(); + git.commit().setMessage("add filter").call(); + + writeTrashFile("Test.txt", "Hello again"); + git.add().addFilepattern("Test.txt").call(); + assertEquals( + "[.gitattributes, mode:100644, content:*.txt filter=test][Test.txt, mode:100644, content:cHceclclcoc cacgcacicn]", + indexState(CONTENT)); + + writeTrashFile("Test.bin", "Hello again"); + git.add().addFilepattern("Test.bin").call(); + assertEquals( + "[.gitattributes, mode:100644, content:*.txt filter=test][Test.bin, mode:100644, content:Hello again][Test.txt, mode:100644, content:cHceclclcoc cacgcacicn]", + indexState(CONTENT)); + + config.setString("filter", "test", "clean", null); + config.save(); + + git.add().addFilepattern("Test.txt").call(); + assertEquals( + "[.gitattributes, mode:100644, content:*.txt filter=test][Test.bin, mode:100644, content:Hello again][Test.txt, mode:100644, content:Hello again]", + indexState(CONTENT)); + + config.setString("filter", "test", "clean", null); + config.save(); + } + + @Test + public void testBuiltinSmudgeFilter() throws IOException, GitAPIException { + String builtinCommandName = "jgit://builtin/test/smudge"; + FilterCommandRegistry.register(builtinCommandName, + new TestCommandFactory('s')); + StoredConfig config = git.getRepository().getConfig(); + config.setString("filter", "test", "smudge", builtinCommandName); + config.save(); + + writeTrashFile(".gitattributes", "*.txt filter=test"); + git.add().addFilepattern(".gitattributes").call(); + git.commit().setMessage("add filter").call(); + + writeTrashFile("Test.txt", "Hello again"); + git.add().addFilepattern("Test.txt").call(); + assertEquals( + "[.gitattributes, mode:100644, content:*.txt filter=test][Test.txt, mode:100644, content:Hello again]", + indexState(CONTENT)); + assertEquals("Hello again", read("Test.txt")); + deleteTrashFile("Test.txt"); + git.checkout().addPath("Test.txt").call(); + assertEquals("sHseslslsos sasgsasisn", read("Test.txt")); + + writeTrashFile("Test.bin", "Hello again"); + git.add().addFilepattern("Test.bin").call(); + assertEquals( + "[.gitattributes, mode:100644, content:*.txt filter=test][Test.bin, mode:100644, content:Hello again][Test.txt, mode:100644, content:Hello again]", + indexState(CONTENT)); + deleteTrashFile("Test.bin"); + git.checkout().addPath("Test.bin").call(); + assertEquals("Hello again", read("Test.bin")); + + config.setString("filter", "test", "clean", null); + config.save(); + + git.add().addFilepattern("Test.txt").call(); + assertEquals( + "[.gitattributes, mode:100644, content:*.txt filter=test][Test.bin, mode:100644, content:Hello again][Test.txt, mode:100644, content:sHseslslsos sasgsasisn]", + indexState(CONTENT)); + + config.setString("filter", "test", "clean", null); + config.save(); + } + + @Test + public void testBuiltinCleanAndSmudgeFilter() throws IOException, GitAPIException { + String builtinCommandPrefix = "jgit://builtin/test/"; + FilterCommandRegistry.register(builtinCommandPrefix + "smudge", + new TestCommandFactory('s')); + FilterCommandRegistry.register(builtinCommandPrefix + "clean", + new TestCommandFactory('c')); + StoredConfig config = git.getRepository().getConfig(); + config.setString("filter", "test", "smudge", builtinCommandPrefix+"smudge"); + config.setString("filter", "test", "clean", + builtinCommandPrefix + "clean"); + config.save(); + + writeTrashFile(".gitattributes", "*.txt filter=test"); + git.add().addFilepattern(".gitattributes").call(); + git.commit().setMessage("add filter").call(); + + writeTrashFile("Test.txt", "Hello again"); + git.add().addFilepattern("Test.txt").call(); + assertEquals( + "[.gitattributes, mode:100644, content:*.txt filter=test][Test.txt, mode:100644, content:cHceclclcoc cacgcacicn]", + indexState(CONTENT)); + assertEquals("Hello again", read("Test.txt")); + deleteTrashFile("Test.txt"); + git.checkout().addPath("Test.txt").call(); + assertEquals("scsHscsescslscslscsoscs scsascsgscsascsiscsn", + read("Test.txt")); + + writeTrashFile("Test.bin", "Hello again"); + git.add().addFilepattern("Test.bin").call(); + assertEquals( + "[.gitattributes, mode:100644, content:*.txt filter=test][Test.bin, mode:100644, content:Hello again][Test.txt, mode:100644, content:cHceclclcoc cacgcacicn]", + indexState(CONTENT)); + deleteTrashFile("Test.bin"); + git.checkout().addPath("Test.bin").call(); + assertEquals("Hello again", read("Test.bin")); + + config.setString("filter", "test", "clean", null); + config.save(); + + git.add().addFilepattern("Test.txt").call(); + assertEquals( + "[.gitattributes, mode:100644, content:*.txt filter=test][Test.bin, mode:100644, content:Hello again][Test.txt, mode:100644, content:scsHscsescslscslscsoscs scsascsgscsascsiscsn]", + indexState(CONTENT)); + + config.setString("filter", "test", "clean", null); + config.save(); + } + +}
diff --git a/org.eclipse.jgit.ui/.classpath b/org.eclipse.jgit.ui/.classpath index a14ade4..110168f 100644 --- a/org.eclipse.jgit.ui/.classpath +++ b/org.eclipse.jgit.ui/.classpath
@@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <classpath> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> <classpathentry kind="src" path="src"/> <classpathentry kind="src" path="resources"/>
diff --git a/org.eclipse.jgit.ui/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit.ui/.settings/org.eclipse.jdt.core.prefs index 1ce7cd0..808ec3a 100644 --- a/org.eclipse.jgit.ui/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.jgit.ui/.settings/org.eclipse.jdt.core.prefs
@@ -7,9 +7,9 @@ org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate @@ -112,7 +112,7 @@ org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=error -org.eclipse.jdt.core.compiler.source=1.7 +org.eclipse.jdt.core.compiler.source=1.8 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
diff --git a/org.eclipse.jgit.ui/META-INF/MANIFEST.MF b/org.eclipse.jgit.ui/META-INF/MANIFEST.MF index 4492356..b2e0750 100644 --- a/org.eclipse.jgit.ui/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit.ui/META-INF/MANIFEST.MF
@@ -3,14 +3,14 @@ Bundle-ManifestVersion: 2 Bundle-Name: %plugin_name Bundle-SymbolicName: org.eclipse.jgit.ui -Bundle-Version: 4.5.1.qualifier +Bundle-Version: 4.6.0.qualifier Bundle-Vendor: %provider_name -Bundle-RequiredExecutionEnvironment: JavaSE-1.7 -Export-Package: org.eclipse.jgit.awtui;version="4.5.1" -Import-Package: org.eclipse.jgit.errors;version="[4.5.1,4.6.0)", - org.eclipse.jgit.lib;version="[4.5.1,4.6.0)", - org.eclipse.jgit.nls;version="[4.5.1,4.6.0)", - org.eclipse.jgit.revplot;version="[4.5.1,4.6.0)", - org.eclipse.jgit.revwalk;version="[4.5.1,4.6.0)", - org.eclipse.jgit.transport;version="[4.5.1,4.6.0)", - org.eclipse.jgit.util;version="[4.5.1,4.6.0)" +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Export-Package: org.eclipse.jgit.awtui;version="4.6.0" +Import-Package: org.eclipse.jgit.errors;version="[4.6.0,4.7.0)", + org.eclipse.jgit.lib;version="[4.6.0,4.7.0)", + org.eclipse.jgit.nls;version="[4.6.0,4.7.0)", + org.eclipse.jgit.revplot;version="[4.6.0,4.7.0)", + org.eclipse.jgit.revwalk;version="[4.6.0,4.7.0)", + org.eclipse.jgit.transport;version="[4.6.0,4.7.0)", + org.eclipse.jgit.util;version="[4.6.0,4.7.0)"
diff --git a/org.eclipse.jgit.ui/pom.xml b/org.eclipse.jgit.ui/pom.xml index e787181..bf79af0 100644 --- a/org.eclipse.jgit.ui/pom.xml +++ b/org.eclipse.jgit.ui/pom.xml
@@ -52,7 +52,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit-parent</artifactId> - <version>4.5.1-SNAPSHOT</version> + <version>4.6.0-SNAPSHOT</version> </parent> <artifactId>org.eclipse.jgit.ui</artifactId>
diff --git a/org.eclipse.jgit/.classpath b/org.eclipse.jgit/.classpath index 04a2be7..cfcf24a 100644 --- a/org.eclipse.jgit/.classpath +++ b/org.eclipse.jgit/.classpath
@@ -2,7 +2,7 @@ <classpath> <classpathentry kind="src" path="src"/> <classpathentry kind="src" path="resources"/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> <classpathentry kind="output" path="bin"/> </classpath>
diff --git a/org.eclipse.jgit/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jgit/.settings/org.eclipse.jdt.core.prefs index bfaf736..4f1759f 100644 --- a/org.eclipse.jgit/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.jgit/.settings/org.eclipse.jdt.core.prefs
@@ -7,9 +7,9 @@ org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate @@ -112,7 +112,7 @@ org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=error -org.eclipse.jdt.core.compiler.source=1.7 +org.eclipse.jdt.core.compiler.source=1.8 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
diff --git a/org.eclipse.jgit/META-INF/MANIFEST.MF b/org.eclipse.jgit/META-INF/MANIFEST.MF index 5aa9185..673f082 100644 --- a/org.eclipse.jgit/META-INF/MANIFEST.MF +++ b/org.eclipse.jgit/META-INF/MANIFEST.MF
@@ -2,12 +2,12 @@ Bundle-ManifestVersion: 2 Bundle-Name: %plugin_name Bundle-SymbolicName: org.eclipse.jgit -Bundle-Version: 4.5.1.qualifier +Bundle-Version: 4.6.0.qualifier Bundle-Localization: plugin Bundle-Vendor: %provider_name Bundle-ActivationPolicy: lazy -Export-Package: org.eclipse.jgit.annotations;version="4.5.1", - org.eclipse.jgit.api;version="4.5.1"; +Export-Package: org.eclipse.jgit.annotations;version="4.6.0", + org.eclipse.jgit.api;version="4.6.0"; uses:="org.eclipse.jgit.revwalk, org.eclipse.jgit.treewalk.filter, org.eclipse.jgit.diff, @@ -21,60 +21,60 @@ org.eclipse.jgit.submodule, org.eclipse.jgit.transport, org.eclipse.jgit.merge", - org.eclipse.jgit.api.errors;version="4.5.1";uses:="org.eclipse.jgit.lib,org.eclipse.jgit.errors", - org.eclipse.jgit.attributes;version="4.5.1", - org.eclipse.jgit.blame;version="4.5.1"; + org.eclipse.jgit.api.errors;version="4.6.0";uses:="org.eclipse.jgit.lib,org.eclipse.jgit.errors", + org.eclipse.jgit.attributes;version="4.6.0", + org.eclipse.jgit.blame;version="4.6.0"; uses:="org.eclipse.jgit.lib, org.eclipse.jgit.revwalk, org.eclipse.jgit.treewalk.filter, org.eclipse.jgit.diff", - org.eclipse.jgit.diff;version="4.5.1"; + org.eclipse.jgit.diff;version="4.6.0"; uses:="org.eclipse.jgit.patch, org.eclipse.jgit.lib, org.eclipse.jgit.treewalk, org.eclipse.jgit.revwalk, org.eclipse.jgit.treewalk.filter, org.eclipse.jgit.util", - org.eclipse.jgit.dircache;version="4.5.1"; + org.eclipse.jgit.dircache;version="4.6.0"; uses:="org.eclipse.jgit.lib, org.eclipse.jgit.treewalk, org.eclipse.jgit.util, org.eclipse.jgit.events, org.eclipse.jgit.attributes", - org.eclipse.jgit.errors;version="4.5.1"; + org.eclipse.jgit.errors;version="4.6.0"; uses:="org.eclipse.jgit.lib, org.eclipse.jgit.internal.storage.pack, org.eclipse.jgit.transport, org.eclipse.jgit.dircache", - org.eclipse.jgit.events;version="4.5.1";uses:="org.eclipse.jgit.lib", - org.eclipse.jgit.fnmatch;version="4.5.1", - org.eclipse.jgit.gitrepo;version="4.5.1"; + org.eclipse.jgit.events;version="4.6.0";uses:="org.eclipse.jgit.lib", + org.eclipse.jgit.fnmatch;version="4.6.0", + org.eclipse.jgit.gitrepo;version="4.6.0"; uses:="org.eclipse.jgit.api, org.eclipse.jgit.lib, org.eclipse.jgit.revwalk, org.xml.sax.helpers, org.xml.sax", - org.eclipse.jgit.gitrepo.internal;version="4.5.1";x-internal:=true, - org.eclipse.jgit.hooks;version="4.5.1";uses:="org.eclipse.jgit.lib", - org.eclipse.jgit.ignore;version="4.5.1", - org.eclipse.jgit.ignore.internal;version="4.5.1";x-friends:="org.eclipse.jgit.test", - org.eclipse.jgit.internal;version="4.5.1";x-friends:="org.eclipse.jgit.test,org.eclipse.jgit.http.test", - org.eclipse.jgit.internal.ketch;version="4.5.1";x-friends:="org.eclipse.jgit.junit,org.eclipse.jgit.test,org.eclipse.jgit.pgm", - org.eclipse.jgit.internal.storage.dfs;version="4.5.1"; + org.eclipse.jgit.gitrepo.internal;version="4.6.0";x-internal:=true, + org.eclipse.jgit.hooks;version="4.6.0";uses:="org.eclipse.jgit.lib", + org.eclipse.jgit.ignore;version="4.6.0", + org.eclipse.jgit.ignore.internal;version="4.6.0";x-friends:="org.eclipse.jgit.test", + org.eclipse.jgit.internal;version="4.6.0";x-friends:="org.eclipse.jgit.test,org.eclipse.jgit.http.test", + org.eclipse.jgit.internal.ketch;version="4.6.0";x-friends:="org.eclipse.jgit.junit,org.eclipse.jgit.test,org.eclipse.jgit.pgm", + org.eclipse.jgit.internal.storage.dfs;version="4.6.0"; x-friends:="org.eclipse.jgit.test, org.eclipse.jgit.http.server, org.eclipse.jgit.http.test", - org.eclipse.jgit.internal.storage.file;version="4.5.1"; + org.eclipse.jgit.internal.storage.file;version="4.6.0"; x-friends:="org.eclipse.jgit.test, org.eclipse.jgit.junit, org.eclipse.jgit.junit.http, org.eclipse.jgit.http.server, - org.eclipse.jgit.lfs.server, + org.eclipse.jgit.lfs, org.eclipse.jgit.pgm, org.eclipse.jgit.pgm.test", - org.eclipse.jgit.internal.storage.pack;version="4.5.1";x-friends:="org.eclipse.jgit.junit,org.eclipse.jgit.test,org.eclipse.jgit.pgm", - org.eclipse.jgit.internal.storage.reftree;version="4.5.1";x-friends:="org.eclipse.jgit.junit,org.eclipse.jgit.test,org.eclipse.jgit.pgm", - org.eclipse.jgit.lib;version="4.5.1"; + org.eclipse.jgit.internal.storage.pack;version="4.6.0";x-friends:="org.eclipse.jgit.junit,org.eclipse.jgit.test,org.eclipse.jgit.pgm", + org.eclipse.jgit.internal.storage.reftree;version="4.6.0";x-friends:="org.eclipse.jgit.junit,org.eclipse.jgit.test,org.eclipse.jgit.pgm", + org.eclipse.jgit.lib;version="4.6.0"; uses:="org.eclipse.jgit.revwalk, org.eclipse.jgit.treewalk.filter, org.eclipse.jgit.util, @@ -84,32 +84,32 @@ org.eclipse.jgit.treewalk, org.eclipse.jgit.transport, org.eclipse.jgit.submodule", - org.eclipse.jgit.merge;version="4.5.1"; + org.eclipse.jgit.merge;version="4.6.0"; uses:="org.eclipse.jgit.lib, org.eclipse.jgit.treewalk, org.eclipse.jgit.revwalk, org.eclipse.jgit.diff, org.eclipse.jgit.dircache, org.eclipse.jgit.api", - org.eclipse.jgit.nls;version="4.5.1", - org.eclipse.jgit.notes;version="4.5.1"; + org.eclipse.jgit.nls;version="4.6.0", + org.eclipse.jgit.notes;version="4.6.0"; uses:="org.eclipse.jgit.lib, org.eclipse.jgit.treewalk, org.eclipse.jgit.revwalk, org.eclipse.jgit.merge", - org.eclipse.jgit.patch;version="4.5.1";uses:="org.eclipse.jgit.lib,org.eclipse.jgit.diff", - org.eclipse.jgit.revplot;version="4.5.1";uses:="org.eclipse.jgit.lib,org.eclipse.jgit.revwalk", - org.eclipse.jgit.revwalk;version="4.5.1"; + org.eclipse.jgit.patch;version="4.6.0";uses:="org.eclipse.jgit.lib,org.eclipse.jgit.diff", + org.eclipse.jgit.revplot;version="4.6.0";uses:="org.eclipse.jgit.lib,org.eclipse.jgit.revwalk", + org.eclipse.jgit.revwalk;version="4.6.0"; uses:="org.eclipse.jgit.lib, org.eclipse.jgit.treewalk, org.eclipse.jgit.treewalk.filter, org.eclipse.jgit.diff, org.eclipse.jgit.revwalk.filter", - org.eclipse.jgit.revwalk.filter;version="4.5.1";uses:="org.eclipse.jgit.revwalk,org.eclipse.jgit.lib,org.eclipse.jgit.util", - org.eclipse.jgit.storage.file;version="4.5.1";uses:="org.eclipse.jgit.lib,org.eclipse.jgit.util", - org.eclipse.jgit.storage.pack;version="4.5.1";uses:="org.eclipse.jgit.lib", - org.eclipse.jgit.submodule;version="4.5.1";uses:="org.eclipse.jgit.lib,org.eclipse.jgit.treewalk.filter,org.eclipse.jgit.treewalk", - org.eclipse.jgit.transport;version="4.5.1"; + org.eclipse.jgit.revwalk.filter;version="4.6.0";uses:="org.eclipse.jgit.revwalk,org.eclipse.jgit.lib,org.eclipse.jgit.util", + org.eclipse.jgit.storage.file;version="4.6.0";uses:="org.eclipse.jgit.lib,org.eclipse.jgit.util", + org.eclipse.jgit.storage.pack;version="4.6.0";uses:="org.eclipse.jgit.lib", + org.eclipse.jgit.submodule;version="4.6.0";uses:="org.eclipse.jgit.lib,org.eclipse.jgit.treewalk.filter,org.eclipse.jgit.treewalk", + org.eclipse.jgit.transport;version="4.6.0"; uses:="org.eclipse.jgit.transport.resolver, org.eclipse.jgit.revwalk, org.eclipse.jgit.internal.storage.pack, @@ -121,23 +121,23 @@ org.eclipse.jgit.transport.http, org.eclipse.jgit.errors, org.eclipse.jgit.storage.pack", - org.eclipse.jgit.transport.http;version="4.5.1";uses:="javax.net.ssl", - org.eclipse.jgit.transport.resolver;version="4.5.1";uses:="org.eclipse.jgit.lib,org.eclipse.jgit.transport", - org.eclipse.jgit.treewalk;version="4.5.1"; + org.eclipse.jgit.transport.http;version="4.6.0";uses:="javax.net.ssl", + org.eclipse.jgit.transport.resolver;version="4.6.0";uses:="org.eclipse.jgit.lib,org.eclipse.jgit.transport", + org.eclipse.jgit.treewalk;version="4.6.0"; uses:="org.eclipse.jgit.lib, org.eclipse.jgit.revwalk, org.eclipse.jgit.attributes, org.eclipse.jgit.treewalk.filter, org.eclipse.jgit.util, org.eclipse.jgit.dircache", - org.eclipse.jgit.treewalk.filter;version="4.5.1";uses:="org.eclipse.jgit.treewalk", - org.eclipse.jgit.util;version="4.5.1"; + org.eclipse.jgit.treewalk.filter;version="4.6.0";uses:="org.eclipse.jgit.treewalk", + org.eclipse.jgit.util;version="4.6.0"; uses:="org.eclipse.jgit.lib, org.eclipse.jgit.transport.http, org.eclipse.jgit.storage.file, org.ietf.jgss", - org.eclipse.jgit.util.io;version="4.5.1" -Bundle-RequiredExecutionEnvironment: JavaSE-1.7 + org.eclipse.jgit.util.io;version="4.6.0" +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Import-Package: com.googlecode.javaewah;version="[0.7.9,0.8.0)", com.jcraft.jsch;version="[0.1.37,0.2.0)", javax.crypto,
diff --git a/org.eclipse.jgit/META-INF/SOURCE-MANIFEST.MF b/org.eclipse.jgit/META-INF/SOURCE-MANIFEST.MF index 7c9b6f6..6ff4c5f 100644 --- a/org.eclipse.jgit/META-INF/SOURCE-MANIFEST.MF +++ b/org.eclipse.jgit/META-INF/SOURCE-MANIFEST.MF
@@ -3,5 +3,5 @@ Bundle-Name: org.eclipse.jgit - Sources Bundle-SymbolicName: org.eclipse.jgit.source Bundle-Vendor: Eclipse.org - JGit -Bundle-Version: 4.5.1.qualifier -Eclipse-SourceBundle: org.eclipse.jgit;version="4.5.1.qualifier";roots="." +Bundle-Version: 4.6.0.qualifier +Eclipse-SourceBundle: org.eclipse.jgit;version="4.6.0.qualifier";roots="."
diff --git a/org.eclipse.jgit/pom.xml b/org.eclipse.jgit/pom.xml index 58b6ef2..86f3e1f 100644 --- a/org.eclipse.jgit/pom.xml +++ b/org.eclipse.jgit/pom.xml
@@ -53,7 +53,7 @@ <parent> <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit-parent</artifactId> - <version>4.5.1-SNAPSHOT</version> + <version>4.6.0-SNAPSHOT</version> </parent> <artifactId>org.eclipse.jgit</artifactId>
diff --git a/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties b/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties index 327ca0a..2c721ea 100644 --- a/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties +++ b/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties
@@ -279,6 +279,7 @@ expectedPktLineWithService=expected pkt-line with ''# service=-'', got ''{0}'' expectedReceivedContentType=expected Content-Type {0}; received Content-Type {1} expectedReportForRefNotReceived={0}: expected report for ref {1} not received +failedToDetermineFilterDefinition=An exception occured while determining filter definitions failedUpdatingRefs=failed updating refs failureDueToOneOfTheFollowing=Failure due to one of the following: failureUpdatingFETCH_HEAD=Failure updating FETCH_HEAD: {0}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/AddCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/AddCommand.java index 1f37833..16ec146 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/AddCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/AddCommand.java
@@ -224,6 +224,11 @@ public DirCache call() throws GitAPIException, NoFilepatternException { entry.setLength(f.getEntryLength()); entry.setLastModified(f.getEntryLastModified()); long len = f.getEntryContentLength(); + // We read and filter the content multiple times. + // f.getEntryContentLength() reads and filters the input and + // inserter.insert(...) does it again. That's because an + // ObjectInserter needs to know the length before it starts + // inserting. TODO: Fix this by using Buffers. try (InputStream in = f.openEntryStream()) { ObjectId id = inserter.insert(OBJ_BLOB, len, in); entry.setObjectId(id);
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutCommand.java index 65508ef..20d0704 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutCommand.java
@@ -318,7 +318,9 @@ else if (orphan) { if (!dco.getToBeDeleted().isEmpty()) { status = new CheckoutResult(Status.NONDELETED, - dco.getToBeDeleted()); + dco.getToBeDeleted(), + new ArrayList<String>(dco.getUpdated().keySet()), + dco.getRemoved()); } else status = new CheckoutResult(new ArrayList<String>(dco .getUpdated().keySet()), dco.getRemoved());
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutResult.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutResult.java index 6a1bfb8..92a67f4 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutResult.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutResult.java
@@ -113,6 +113,28 @@ public enum Status { * {@link Status#CONFLICTS} or {@link Status#NONDELETED}. */ CheckoutResult(Status status, List<String> fileList) { + this(status, fileList, null, null); + } + + /** + * Create a new fail result. If status is {@link Status#CONFLICTS}, + * <code>fileList</code> is a list of conflicting files, if status is + * {@link Status#NONDELETED}, <code>fileList</code> is a list of not deleted + * files. All other values ignore <code>fileList</code>. To create a result + * for {@link Status#OK}, see {@link #CheckoutResult(List, List)}. + * + * @param status + * the failure status + * @param fileList + * the list of files to store, status has to be either + * {@link Status#CONFLICTS} or {@link Status#NONDELETED}. + * @param modified + * the modified files + * @param removed + * the removed files. + */ + CheckoutResult(Status status, List<String> fileList, List<String> modified, + List<String> removed) { myStatus = status; if (status == Status.CONFLICTS) this.conflictList = fileList; @@ -123,8 +145,8 @@ public enum Status { else this.undeletedList = new ArrayList<String>(0); - this.modifiedList = new ArrayList<String>(0); - this.removedList = new ArrayList<String>(0); + this.modifiedList = modified; + this.removedList = removed; } /**
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/attributes/FilterCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/attributes/FilterCommand.java new file mode 100644 index 0000000..10be588 --- /dev/null +++ b/org.eclipse.jgit/src/org/eclipse/jgit/attributes/FilterCommand.java
@@ -0,0 +1,94 @@ +/* + * Copyright (C) 2016, Christian Halstrick <christian.halstrick@sap.com> + * and other copyright owners as documented in the project's IP log. + * + * This program and the accompanying materials are made available + * under the terms of the Eclipse Distribution License v1.0 which + * accompanies this distribution, is reproduced below, and is + * available at http://www.eclipse.org/org/documents/edl-v10.php + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * + * - Neither the name of the Eclipse Foundation, Inc. nor the + * names of its contributors may be used to endorse or promote + * products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.eclipse.jgit.attributes; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; + +/** + * An abstraction for JGit's builtin implementations for hooks and filters. + * Instead of spawning an external processes to start a filter/hook and to pump + * data from/to stdin/stdout these builtin commmands may be used. They are + * constructed by {@link FilterCommandFactory}. + * + * @since 4.6 + */ +public abstract class FilterCommand { + /** + * The {@link InputStream} this command should read from + */ + protected InputStream in; + + /** + * The {@link OutputStream} this command should write to + */ + protected OutputStream out; + + /** + * @param in + * The {@link InputStream} this command should read from + * @param out + * The {@link OutputStream} this command should write to + */ + public FilterCommand(InputStream in, OutputStream out) { + this.in = in; + this.out = out; + } + + /** + * Execute the command. The command is supposed to read data from + * {@link #in} and to write the result to {@link #out}. It returns the + * number of bytes it read from {@link #in}. It should be called in a loop + * until it returns -1 signaling that the {@link InputStream} is completely + * processed. + * + * @return the number of bytes read from the {@link InputStream} or -1. -1 + * means that the {@link InputStream} is completely processed. + * @throws IOException + * when {@link IOException} occured while reading from + * {@link #in} or writing to {@link #out} + * + */ + public abstract int run() throws IOException; +}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/attributes/FilterCommandFactory.java b/org.eclipse.jgit/src/org/eclipse/jgit/attributes/FilterCommandFactory.java new file mode 100644 index 0000000..6b973da --- /dev/null +++ b/org.eclipse.jgit/src/org/eclipse/jgit/attributes/FilterCommandFactory.java
@@ -0,0 +1,73 @@ +/* + * Copyright (C) 2016, Christian Halstrick <christian.halstrick@sap.com> + * and other copyright owners as documented in the project's IP log. + * + * This program and the accompanying materials are made available + * under the terms of the Eclipse Distribution License v1.0 which + * accompanies this distribution, is reproduced below, and is + * available at http://www.eclipse.org/org/documents/edl-v10.php + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * + * - Neither the name of the Eclipse Foundation, Inc. nor the + * names of its contributors may be used to endorse or promote + * products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.eclipse.jgit.attributes; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; + +import org.eclipse.jgit.lib.Repository; + +/** + * The factory responsible for creating instances of {@link FilterCommand}. + * + * @since 4.6 + */ +public interface FilterCommandFactory { + /** + * Create a new {@link FilterCommand}. + * + * @param db + * the repository this command should work on + * @param in + * the {@link InputStream} this command should read from + * @param out + * the {@link OutputStream} this command should write to + * @return the created {@link FilterCommand} + * @throws IOException + * thrown when the command constructor throws an IOException + */ + public FilterCommand create(Repository db, InputStream in, + OutputStream out) throws IOException; + +}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/attributes/FilterCommandRegistry.java b/org.eclipse.jgit/src/org/eclipse/jgit/attributes/FilterCommandRegistry.java new file mode 100644 index 0000000..3fbaedb --- /dev/null +++ b/org.eclipse.jgit/src/org/eclipse/jgit/attributes/FilterCommandRegistry.java
@@ -0,0 +1,140 @@ +/* + * Copyright (C) 2016, Matthias Sohn <matthias.sohn@sap.com> + * and other copyright owners as documented in the project's IP log. + * + * This program and the accompanying materials are made available + * under the terms of the Eclipse Distribution License v1.0 which + * accompanies this distribution, is reproduced below, and is + * available at http://www.eclipse.org/org/documents/edl-v10.php + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * + * - Neither the name of the Eclipse Foundation, Inc. nor the + * names of its contributors may be used to endorse or promote + * products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.eclipse.jgit.attributes; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; + +import org.eclipse.jgit.lib.Repository; + +/** + * Registry for built-in filters + * + * @since 4.6 + */ +public class FilterCommandRegistry { + private static ConcurrentHashMap<String, FilterCommandFactory> filterCommandRegistry = new ConcurrentHashMap<>(); + + /** + * Registers a {@link FilterCommandFactory} responsible for creating + * {@link FilterCommand}s for a certain command name. If the factory f1 is + * registered for the name "jgit://builtin/x" then a call to + * <code>getCommand("jgit://builtin/x", ...)</code> will call + * <code>f1(...)</code> to create a new instance of {@link FilterCommand} + * + * @param filterCommandName + * the command name for which this factory is registered + * @param factory + * the factory responsible for creating {@link FilterCommand}s + * for the specified name + * @return the previous factory associated with <tt>commandName</tt>, or + * <tt>null</tt> if there was no mapping for <tt>commandName</tt> + */ + public static FilterCommandFactory register(String filterCommandName, + FilterCommandFactory factory) { + return filterCommandRegistry.put(filterCommandName, factory); + } + + /** + * Unregisters the {@link FilterCommandFactory} registered for the given + * command name + * + * @param filterCommandName + * the FilterCommandFactory's filter command name + * @return the previous factory associated with <tt>filterCommandName</tt>, + * or <tt>null</tt> if there was no mapping for <tt>commandName</tt> + */ + public static FilterCommandFactory unregister(String filterCommandName) { + return filterCommandRegistry.remove(filterCommandName); + } + + /** + * Checks whether any {@link FilterCommandFactory} is registered for a given + * command name + * + * @param filterCommandName + * the name for which the registry should be checked + * @return <code>true</code> if any factory was registered for the name + */ + public static boolean isRegistered(String filterCommandName) { + return filterCommandRegistry.containsKey(filterCommandName); + } + + /** + * @return Set of commandNames for which a {@link FilterCommandFactory} is + * registered + */ + public static Set<String> getRegisteredFilterCommands() { + return filterCommandRegistry.keySet(); + } + + /** + * Creates a new {@link FilterCommand} for the given name. A factory must be + * registered for the name in advance. + * + * @param filterCommandName + * The name for which a new {@link FilterCommand} should be + * created + * @param db + * the repository this command should work on + * @param in + * the {@link InputStream} this {@link FilterCommand} should read + * from + * @param out + * the {@link OutputStream} this {@link FilterCommand} should + * write to + * @return the command if a command could be created or <code>null</code> if + * there was no factory registered for that name + * @throws IOException + */ + public static FilterCommand createFilterCommand(String filterCommandName, + Repository db, InputStream in, OutputStream out) + throws IOException { + FilterCommandFactory cf = filterCommandRegistry.get(filterCommandName); + return (cf == null) ? null : cf.create(db, in, out); + } + +}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java index 8af7e46..c318443 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java
@@ -54,6 +54,8 @@ import java.util.Map; import org.eclipse.jgit.api.errors.FilterFailedException; +import org.eclipse.jgit.attributes.FilterCommand; +import org.eclipse.jgit.attributes.FilterCommandRegistry; import org.eclipse.jgit.errors.CheckoutConflictException; import org.eclipse.jgit.errors.CorruptObjectException; import org.eclipse.jgit.errors.IncorrectObjectTypeException; @@ -86,11 +88,15 @@ import org.eclipse.jgit.util.RawParseUtils; import org.eclipse.jgit.util.SystemReader; import org.eclipse.jgit.util.io.EolStreamTypeUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * This class handles checking out one or two trees merging with the index. */ public class DirCacheCheckout { + private static Logger LOG = LoggerFactory.getLogger(DirCacheCheckout.class); + private static final int MAX_EXCEPTION_TEXT_SIZE = 10 * 1024; /** @@ -1303,45 +1309,19 @@ public static void checkoutEntry(Repository repo, DirCacheEntry entry, } else { nonNullEolStreamType = EolStreamType.DIRECT; } - OutputStream channel = EolStreamTypeUtil.wrapOutputStream( - new FileOutputStream(tmpFile), nonNullEolStreamType); - if (checkoutMetadata.smudgeFilterCommand != null) { - ProcessBuilder filterProcessBuilder = fs.runInShell( - checkoutMetadata.smudgeFilterCommand, new String[0]); - filterProcessBuilder.directory(repo.getWorkTree()); - filterProcessBuilder.environment().put(Constants.GIT_DIR_KEY, - repo.getDirectory().getAbsolutePath()); - ExecutionResult result; - int rc; - try { - // TODO: wire correctly with AUTOCRLF - result = fs.execute(filterProcessBuilder, ol.openStream()); - rc = result.getRc(); - if (rc == 0) { - result.getStdout().writeTo(channel, - NullProgressMonitor.INSTANCE); + try (OutputStream channel = EolStreamTypeUtil.wrapOutputStream( + new FileOutputStream(tmpFile), nonNullEolStreamType)) { + if (checkoutMetadata.smudgeFilterCommand != null) { + if (FilterCommandRegistry + .isRegistered(checkoutMetadata.smudgeFilterCommand)) { + runBuiltinFilterCommand(repo, checkoutMetadata, ol, + channel); + } else { + runExternalFilterCommand(repo, entry, checkoutMetadata, ol, + fs, channel); } - } catch (IOException | InterruptedException e) { - throw new IOException(new FilterFailedException(e, - checkoutMetadata.smudgeFilterCommand, - entry.getPathString())); - - } finally { - channel.close(); - } - if (rc != 0) { - throw new IOException(new FilterFailedException(rc, - checkoutMetadata.smudgeFilterCommand, - entry.getPathString(), - result.getStdout().toByteArray(MAX_EXCEPTION_TEXT_SIZE), - RawParseUtils.decode(result.getStderr() - .toByteArray(MAX_EXCEPTION_TEXT_SIZE)))); - } - } else { - try { + } else { ol.copyTo(channel); - } finally { - channel.close(); } } // The entry needs to correspond to the on-disk filesize. If the content @@ -1382,6 +1362,63 @@ public static void checkoutEntry(Repository repo, DirCacheEntry entry, entry.setLastModified(fs.lastModified(f)); } + // Run an external filter command + private static void runExternalFilterCommand(Repository repo, + DirCacheEntry entry, + CheckoutMetadata checkoutMetadata, ObjectLoader ol, FS fs, + OutputStream channel) throws IOException { + ProcessBuilder filterProcessBuilder = fs.runInShell( + checkoutMetadata.smudgeFilterCommand, new String[0]); + filterProcessBuilder.directory(repo.getWorkTree()); + filterProcessBuilder.environment().put(Constants.GIT_DIR_KEY, + repo.getDirectory().getAbsolutePath()); + ExecutionResult result; + int rc; + try { + // TODO: wire correctly with AUTOCRLF + result = fs.execute(filterProcessBuilder, ol.openStream()); + rc = result.getRc(); + if (rc == 0) { + result.getStdout().writeTo(channel, + NullProgressMonitor.INSTANCE); + } + } catch (IOException | InterruptedException e) { + throw new IOException(new FilterFailedException(e, + checkoutMetadata.smudgeFilterCommand, + entry.getPathString())); + } + if (rc != 0) { + throw new IOException(new FilterFailedException(rc, + checkoutMetadata.smudgeFilterCommand, + entry.getPathString(), + result.getStdout().toByteArray(MAX_EXCEPTION_TEXT_SIZE), + RawParseUtils.decode(result.getStderr() + .toByteArray(MAX_EXCEPTION_TEXT_SIZE)))); + } + } + + // Run a builtin filter command + private static void runBuiltinFilterCommand(Repository repo, + CheckoutMetadata checkoutMetadata, ObjectLoader ol, + OutputStream channel) throws MissingObjectException, IOException { + FilterCommand command = null; + try { + command = FilterCommandRegistry.createFilterCommand( + checkoutMetadata.smudgeFilterCommand, repo, ol.openStream(), + channel); + } catch (IOException e) { + LOG.error(JGitText.get().failedToDetermineFilterDefinition, e); + // In case an IOException occurred during creating of the command + // then proceed as if there would not have been a builtin filter. + ol.copyTo(channel); + } + if (command != null) { + while (command.run() != -1) { + // loop as long as command.run() tells there is work to do + } + } + } + @SuppressWarnings("deprecation") private static void checkValidPath(CanonicalTreeParser t) throws InvalidPathException {
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java index 758f71d..956171b 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java
@@ -338,6 +338,7 @@ public static JGitText get() { /***/ public String expectedPktLineWithService; /***/ public String expectedReceivedContentType; /***/ public String expectedReportForRefNotReceived; + /***/ public String failedToDetermineFilterDefinition; /***/ public String failedUpdatingRefs; /***/ public String failureDueToOneOfTheFollowing; /***/ public String failureUpdatingFETCH_HEAD;
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsBlockCache.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsBlockCache.java index ecd4b23..2c89535 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsBlockCache.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsBlockCache.java
@@ -175,6 +175,7 @@ public static DfsBlockCache getInstance() { /** Number of bytes currently loaded in the cache. */ private volatile long liveBytes; + @SuppressWarnings("unchecked") private DfsBlockCache(final DfsBlockCacheConfig cfg) { tableSize = tableSize(cfg); if (tableSize < 1) @@ -416,6 +417,7 @@ private void creditSpace(int credit) { clockLock.unlock(); } + @SuppressWarnings("unchecked") private void addToClock(Ref ref, int credit) { clockLock.lock(); try {
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Constants.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Constants.java index d30edaf..f9350a5 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Constants.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Constants.java
@@ -391,6 +391,20 @@ public final class Constants { */ public static final String ATTR_FILTER_TYPE_SMUDGE = "smudge"; + /** + * Whether to use JGit's implementations of filters and hooks + * + * @since 4.6 + */ + public static final String ATTR_FILTER_USE_BUILTIN = "useJGitBuiltin"; + + /** + * Builtin filter commands start with this prefix + * + * @since 4.6 + */ + public static final String BUILTIN_FILTER_PREFIX = "jgit://builtin/"; + /** Name of the ignore file */ public static final String DOT_GIT_IGNORE = ".gitignore";
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java index aba5242..e9ff504 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java
@@ -1183,15 +1183,6 @@ public void onIndexChanged(IndexChangedEvent event) { return DirCache.lock(this, l); } - static byte[] gitInternalSlash(byte[] bytes) { - if (File.separatorChar == '/') - return bytes; - for (int i=0; i<bytes.length; ++i) - if (bytes[i] == File.separatorChar) - bytes[i] = '/'; - return bytes; - } - /** * @return an important state */
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RepositoryCache.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RepositoryCache.java index 2e0ed16..e5a0553 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RepositoryCache.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RepositoryCache.java
@@ -150,7 +150,7 @@ public static void register(final Repository db) { public static void close(@NonNull final Repository db) { if (db.getDirectory() != null) { FileKey key = FileKey.exact(db.getDirectory(), db.getFS()); - cache.unregisterAndCloseRepository(key, db); + cache.unregisterAndCloseRepository(key); } } @@ -302,8 +302,7 @@ private boolean isExpired(Repository db) { && (System.currentTimeMillis() - db.closedAt.get() > expireAfter); } - private void unregisterAndCloseRepository(final Key location, - Repository db) { + private void unregisterAndCloseRepository(final Key location) { synchronized (lockFor(location)) { Repository oldDb = unregisterRepository(location); if (oldDb != null) {
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseReceivePack.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseReceivePack.java index 0724eac..4d0803a 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseReceivePack.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseReceivePack.java
@@ -69,6 +69,7 @@ import java.util.Set; import java.util.concurrent.TimeUnit; +import org.eclipse.jgit.annotations.Nullable; import org.eclipse.jgit.errors.InvalidObjectIdException; import org.eclipse.jgit.errors.MissingObjectException; import org.eclipse.jgit.errors.PackProtocolException; @@ -268,6 +269,7 @@ public Set<String> getCapabilities() { private PushCertificateParser pushCertificateParser; private SignedPushConfig signedPushConfig; private PushCertificate pushCert; + private ReceivedPackStatistics stats; /** * Get the push certificate used to verify the pusher's identity. @@ -1115,6 +1117,18 @@ public void sendAdvertisedRefs(final RefAdvertiser adv) } /** + * Returns the statistics on the received pack if available. This should be + * called after {@link #receivePack} is called. + * + * @return ReceivedPackStatistics + * @since 4.6 + */ + @Nullable + public ReceivedPackStatistics getReceivedPackStatistics() { + return stats; + } + + /** * Receive a list of commands from the input. * * @throws IOException @@ -1307,6 +1321,7 @@ private void receivePack() throws IOException { parser.setMaxObjectSizeLimit(maxObjectSizeLimit); packLock = parser.parse(receiving, resolving); packSize = Long.valueOf(parser.getPackSize()); + stats = parser.getReceivedPackStatistics(); ins.flush(); }
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PackParser.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PackParser.java index b96fe88..4bbe3f8 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PackParser.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PackParser.java
@@ -186,6 +186,9 @@ public static enum Source { /** Git object size limit */ private long maxObjectSizeLimit; + private final ReceivedPackStatistics.Builder stats = + new ReceivedPackStatistics.Builder(); + /** * Initialize a pack parser. * @@ -455,8 +458,8 @@ public List<PackedObjectInfo> getSortedObjectList( } /** - * Get the size of the parsed pack. - * + * Get the size of the newly created pack. + * <p> * This will also include the pack index size if an index was created. This * method should only be called after pack parsing is finished. * @@ -469,6 +472,18 @@ public long getPackSize() { } /** + * Returns the statistics of the parsed pack. + * <p> + * This should only be called after pack parsing is finished. + * + * @return {@link ReceivedPackStatistics} + * @since 4.6 + */ + public ReceivedPackStatistics getReceivedPackStatistics() { + return stats.build(); + } + + /** * Parse the pack stream. * * @param progress @@ -626,6 +641,7 @@ private void resolveDeltas(final PackedObjectInfo oe, private void resolveDeltas(DeltaVisit visit, final int type, ObjectTypeAndSize info, ProgressMonitor progress) throws IOException { + stats.addDeltaObject(type); do { progress.update(1); info = openDatabase(visit.delta, info); @@ -919,6 +935,7 @@ private void readPackFooter() throws IOException { // Cleanup all resources associated with our input parsing. private void endInput() { + stats.setNumBytesRead(streamPosition()); in = null; } @@ -947,12 +964,14 @@ private void indexOneObject() throws IOException { case Constants.OBJ_TREE: case Constants.OBJ_BLOB: case Constants.OBJ_TAG: + stats.addWholeObject(typeCode); onBeginWholeObject(streamPosition, typeCode, sz); onObjectHeader(Source.INPUT, hdrBuf, 0, hdrPtr); whole(streamPosition, typeCode, sz); break; case Constants.OBJ_OFS_DELTA: { + stats.addOffsetDelta(); c = readFrom(Source.INPUT); hdrBuf[hdrPtr++] = (byte) c; long ofs = c & 127; @@ -975,6 +994,7 @@ private void indexOneObject() throws IOException { } case Constants.OBJ_REF_DELTA: { + stats.addRefDelta(); c = fill(Source.INPUT, 20); final ObjectId base = ObjectId.fromRaw(buf, c); System.arraycopy(buf, c, hdrBuf, hdrPtr, 20);
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceivedPackStatistics.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceivedPackStatistics.java new file mode 100644 index 0000000..052d550 --- /dev/null +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceivedPackStatistics.java
@@ -0,0 +1,231 @@ +/* + * Copyright (C) 2016, Google Inc. + * and other copyright owners as documented in the project's IP log. + * + * This program and the accompanying materials are made available + * under the terms of the Eclipse Distribution License v1.0 which + * accompanies this distribution, is reproduced below, and is + * available at http://www.eclipse.org/org/documents/edl-v10.php + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * + * - Neither the name of the Eclipse Foundation, Inc. nor the + * names of its contributors may be used to endorse or promote + * products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package org.eclipse.jgit.transport; + +import org.eclipse.jgit.lib.Constants; + +/** + * Statistics about {@link PackParser}. + * + * @since 4.6 + */ +public class ReceivedPackStatistics { + private long numBytesRead; + + private long numWholeCommit; + private long numWholeTree; + private long numWholeBlob; + private long numWholeTag; + private long numOfsDelta; + private long numRefDelta; + + private long numDeltaCommit; + private long numDeltaTree; + private long numDeltaBlob; + private long numDeltaTag; + + /** @return number of bytes read from the input stream */ + public long getNumBytesRead() { + return numBytesRead; + } + + /** @return number of whole commit objects in the pack */ + public long getNumWholeCommit() { + return numWholeCommit; + } + + /** @return number of whole tree objects in the pack */ + public long getNumWholeTree() { + return numWholeTree; + } + + /** @return number of whole blob objects in the pack */ + public long getNumWholeBlob() { + return numWholeBlob; + } + + /** @return number of whole tag objects in the pack */ + public long getNumWholeTag() { + return numWholeTag; + } + + /** @return number of offset delta objects in the pack */ + public long getNumOfsDelta() { + return numOfsDelta; + } + + /** @return number of ref delta objects in the pack */ + public long getNumRefDelta() { + return numRefDelta; + } + + /** @return number of delta commit objects in the pack */ + public long getNumDeltaCommit() { + return numDeltaCommit; + } + + /** @return number of delta tree objects in the pack */ + public long getNumDeltaTree() { + return numDeltaTree; + } + + /** @return number of delta blob objects in the pack */ + public long getNumDeltaBlob() { + return numDeltaBlob; + } + + /** @return number of delta tag objects in the pack */ + public long getNumDeltaTag() { + return numDeltaTag; + } + + /** A builder for {@link ReceivedPackStatistics}. */ + public static class Builder { + private long numBytesRead; + + private long numWholeCommit; + private long numWholeTree; + private long numWholeBlob; + private long numWholeTag; + private long numOfsDelta; + private long numRefDelta; + + private long numDeltaCommit; + private long numDeltaTree; + private long numDeltaBlob; + private long numDeltaTag; + + /** + * @param numBytesRead number of bytes read from the input stream + * @return this + */ + public Builder setNumBytesRead(long numBytesRead) { + this.numBytesRead = numBytesRead; + return this; + } + + /** + * Increment a whole object count. + * + * @param type OBJ_COMMIT, OBJ_TREE, OBJ_BLOB, or OBJ_TAG + * @return this + */ + public Builder addWholeObject(int type) { + switch (type) { + case Constants.OBJ_COMMIT: + numWholeCommit++; + break; + case Constants.OBJ_TREE: + numWholeTree++; + break; + case Constants.OBJ_BLOB: + numWholeBlob++; + break; + case Constants.OBJ_TAG: + numWholeTag++; + break; + default: + throw new IllegalArgumentException( + type + " cannot be a whole object"); //$NON-NLS-1$ + } + return this; + } + + /** @return this */ + public Builder addOffsetDelta() { + numOfsDelta++; + return this; + } + + /** @return this */ + public Builder addRefDelta() { + numRefDelta++; + return this; + } + + /** + * Increment a delta object count. + * + * @param type OBJ_COMMIT, OBJ_TREE, OBJ_BLOB, or OBJ_TAG + * @return this + */ + public Builder addDeltaObject(int type) { + switch (type) { + case Constants.OBJ_COMMIT: + numDeltaCommit++; + break; + case Constants.OBJ_TREE: + numDeltaTree++; + break; + case Constants.OBJ_BLOB: + numDeltaBlob++; + break; + case Constants.OBJ_TAG: + numDeltaTag++; + break; + default: + throw new IllegalArgumentException( + "delta should be a delta to a whole object. " + //$NON-NLS-1$ + type + " cannot be a whole object"); //$NON-NLS-1$ + } + return this; + } + + ReceivedPackStatistics build() { + ReceivedPackStatistics s = new ReceivedPackStatistics(); + s.numBytesRead = numBytesRead; + s.numWholeCommit = numWholeCommit; + s.numWholeTree = numWholeTree; + s.numWholeBlob = numWholeBlob; + s.numWholeTag = numWholeTag; + s.numOfsDelta = numOfsDelta; + s.numRefDelta = numRefDelta; + s.numDeltaCommit = numDeltaCommit; + s.numDeltaTree = numDeltaTree; + s.numDeltaBlob = numDeltaBlob; + s.numDeltaTag = numDeltaTag; + return s; + } + } +}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java index d1fd67e..2ef097a 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java
@@ -313,6 +313,7 @@ public Set<String> getOptions() { private PackStatistics statistics; + @SuppressWarnings("deprecation") private UploadPackLogger logger = UploadPackLogger.NULL; /** @@ -1428,6 +1429,7 @@ private boolean reportInternalServerErrorOverSideband() { } } + @SuppressWarnings("deprecation") private void sendPack(final boolean sideband) throws IOException { ProgressMonitor pm = NullProgressMonitor.INSTANCE; OutputStream packOut = rawOut;
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPackLogger.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPackLogger.java index 85ebecc..0588634 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPackLogger.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPackLogger.java
@@ -56,7 +56,7 @@ * @deprecated use {@link PostUploadHook} instead */ @Deprecated -public interface UploadPackLogger { +public interface UploadPackLogger { // TODO remove in JGit 5.0 /** A simple no-op logger. */ public static final UploadPackLogger NULL = new UploadPackLogger() { public void onPackStatistics(PackWriter.Statistics stats) {
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkFetchConnection.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkFetchConnection.java index 17edfdc..c90cadf 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkFetchConnection.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/WalkFetchConnection.java
@@ -195,7 +195,7 @@ class WalkFetchConnection extends BaseFetchConnection { local = wt.local; objCheck = wt.getObjectChecker(); inserter = local.newObjectInserter(); - reader = local.newObjectReader(); + reader = inserter.newReader(); remotes = new ArrayList<WalkRemoteObjectDatabase>(); remotes.add(w); @@ -240,6 +240,12 @@ protected void doFetch(final ProgressMonitor monitor, downloadObject(monitor, id); process(id); } + + try { + inserter.flush(); + } catch (IOException e) { + throw new TransportException(e.getMessage(), e); + } } public Collection<PackLock> getPackLocks() { @@ -652,7 +658,6 @@ private void verifyAndInsertLooseObject(final AnyObjectId id, Constants.typeString(type), Integer.valueOf(compressed.length))); } - inserter.flush(); } private Collection<WalkRemoteObjectDatabase> expandOneAlternate( @@ -883,7 +888,6 @@ void downloadPack(final ProgressMonitor monitor) throws IOException { PackLock lock = parser.parse(monitor); if (lock != null) packLocks.add(lock); - inserter.flush(); } } }
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/FileTreeIterator.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/FileTreeIterator.java index db81e1a..afa2ed9 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/FileTreeIterator.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/FileTreeIterator.java
@@ -426,4 +426,9 @@ public File getEntryFile() { protected byte[] idSubmodule(final Entry e) { return idSubmodule(getDirectory(), e); } + + @Override + protected String readSymlinkTarget(Entry entry) throws IOException { + return fs.readSymLink(getEntryFile()); + } }
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/TreeWalk.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/TreeWalk.java index 911b7ff..21cd6b8 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/TreeWalk.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/TreeWalk.java
@@ -55,6 +55,7 @@ import org.eclipse.jgit.attributes.Attributes; import org.eclipse.jgit.attributes.AttributesNodeProvider; import org.eclipse.jgit.attributes.AttributesProvider; +import org.eclipse.jgit.attributes.FilterCommandRegistry; import org.eclipse.jgit.dircache.DirCacheBuildIterator; import org.eclipse.jgit.attributes.AttributesHandler; import org.eclipse.jgit.dircache.DirCacheIterator; @@ -313,6 +314,8 @@ public static TreeWalk forPath(final Repository db, final String path, private Config config; + private Set<String> filterCommands; + /** * Create a new tree walker for a given repository. * @@ -357,6 +360,8 @@ private TreeWalk(final @Nullable Repository repo, final ObjectReader or, if (repo != null) { config = repo.getConfig(); attributesNodeProvider = repo.createAttributesNodeProvider(); + filterCommands = FilterCommandRegistry + .getRegisteredFilterCommands(); } else { config = null; attributesNodeProvider = null; @@ -1369,8 +1374,19 @@ private String getFilterCommandDefinition(String filterDriverName, return filterCommand; filterCommand = config.getString(Constants.ATTR_FILTER, filterDriverName, filterCommandType); - if (filterCommand != null) + boolean useBuiltin = config.getBoolean(Constants.ATTR_FILTER, + filterDriverName, Constants.ATTR_FILTER_USE_BUILTIN, false); + if (useBuiltin) { + String builtinFilterCommand = Constants.BUILTIN_FILTER_PREFIX + + filterDriverName + '/' + filterCommandType; + if (filterCommands != null + && filterCommands.contains(builtinFilterCommand)) { + filterCommand = builtinFilterCommand; + } + } + if (filterCommand != null) { filterCommandsByNameDotType.put(key, filterCommand); + } return filterCommand; } }
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java index 9a3fa80..52477cb 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java
@@ -65,6 +65,8 @@ import org.eclipse.jgit.api.errors.FilterFailedException; import org.eclipse.jgit.attributes.AttributesNode; import org.eclipse.jgit.attributes.AttributesRule; +import org.eclipse.jgit.attributes.FilterCommand; +import org.eclipse.jgit.attributes.FilterCommandRegistry; import org.eclipse.jgit.diff.RawText; import org.eclipse.jgit.dircache.DirCache; import org.eclipse.jgit.dircache.DirCacheEntry; @@ -93,6 +95,8 @@ import org.eclipse.jgit.util.IO; import org.eclipse.jgit.util.Paths; import org.eclipse.jgit.util.RawParseUtils; +import org.eclipse.jgit.util.TemporaryBuffer; +import org.eclipse.jgit.util.TemporaryBuffer.LocalFile; import org.eclipse.jgit.util.io.AutoLFInputStream; import org.eclipse.jgit.util.io.EolStreamTypeUtil; @@ -263,7 +267,6 @@ public boolean hasId() { // If there is a matching DirCacheIterator, we can reuse // its idBuffer, but only if we appear to be clean against // the cached index information for the path. - // DirCacheIterator i = state.walk.getTree(state.dirCacheTree, DirCacheIterator.class); if (i != null) { @@ -393,15 +396,9 @@ && getEolStreamType(opType) == EolStreamType.DIRECT) { if (len <= MAXIMUM_FILE_SIZE_TO_READ_FULLY) { ByteBuffer rawbuf = IO.readWholeStream(is, (int) len); - byte[] raw = rawbuf.array(); - int n = rawbuf.limit(); - if (!isBinary(raw, n)) { - rawbuf = filterClean(raw, n, opType); - raw = rawbuf.array(); - n = rawbuf.limit(); - } - canonLen = n; - return new ByteArrayInputStream(raw, 0, n); + rawbuf = filterClean(rawbuf.array(), rawbuf.limit(), opType); + canonLen = rawbuf.limit(); + return new ByteArrayInputStream(rawbuf.array(), 0, (int) canonLen); } if (getCleanFilterCommand() == null && isBinary(e)) { @@ -429,10 +426,6 @@ private static void safeClose(final InputStream in) { } } - private static boolean isBinary(byte[] content, int sz) { - return RawText.isBinary(content, sz); - } - private static boolean isBinary(Entry entry) throws IOException { InputStream in = entry.openInputStream(); try { @@ -461,6 +454,16 @@ private InputStream filterClean(InputStream in, OperationType opType) in = handleAutoCRLF(in, opType); String filterCommand = getCleanFilterCommand(); if (filterCommand != null) { + if (FilterCommandRegistry.isRegistered(filterCommand)) { + LocalFile buffer = new TemporaryBuffer.LocalFile(null); + FilterCommand command = FilterCommandRegistry + .createFilterCommand(filterCommand, repository, in, + buffer); + while (command.run() != -1) { + // loop as long as command.run() tells there is work to do + } + return buffer.openInputStream(); + } FS fs = repository.getFS(); ProcessBuilder filterProcessBuilder = fs.runInShell(filterCommand, new String[0]); @@ -1005,10 +1008,10 @@ private boolean contentCheck(DirCacheEntry entry, ObjectReader reader) return false; } else { - if (mode == FileMode.SYMLINK.getBits()) - return !new File(readContentAsNormalizedString(current())) - .equals(new File((readContentAsNormalizedString(entry, - reader)))); + if (mode == FileMode.SYMLINK.getBits()) { + return !new File(readSymlinkTarget(current())).equals( + new File(readContentAsNormalizedString(entry, reader))); + } // Content differs: that's a real change, perhaps if (reader == null) // deprecated use, do no further checks return true; @@ -1054,12 +1057,30 @@ private static String readContentAsNormalizedString(DirCacheEntry entry, return FS.detect().normalize(RawParseUtils.decode(cachedBytes)); } - private static String readContentAsNormalizedString(Entry entry) throws IOException { + /** + * Reads the target of a symlink as a string. This default implementation + * fully reads the entry's input stream and converts it to a normalized + * string. Subclasses may override to provide more specialized + * implementations. + * + * @param entry + * to read + * @return the entry's content as a normalized string + * @throws IOException + * if the entry cannot be read or does not denote a symlink + * @since 4.6 + */ + protected String readSymlinkTarget(Entry entry) throws IOException { + if (!entry.getMode().equals(FileMode.SYMLINK)) { + throw new java.nio.file.NotLinkException(entry.getName()); + } long length = entry.getLength(); byte[] content = new byte[(int) length]; - InputStream is = entry.openInputStream(); - IO.readFully(is, content, 0, (int) length); - return FS.detect().normalize(RawParseUtils.decode(content)); + try (InputStream is = entry.openInputStream()) { + int bytesRead = IO.readFully(is, content, 0); + return FS.detect() + .normalize(RawParseUtils.decode(content, 0, bytesRead)); + } } private static long computeLength(InputStream in) throws IOException {
diff --git a/pom.xml b/pom.xml index 3a9a6c6..d3d28e5 100644 --- a/pom.xml +++ b/pom.xml
@@ -51,7 +51,7 @@ <groupId>org.eclipse.jgit</groupId> <artifactId>org.eclipse.jgit-parent</artifactId> <packaging>pom</packaging> - <version>4.5.1-SNAPSHOT</version> + <version>4.6.0-SNAPSHOT</version> <name>JGit - Parent</name> <url>${jgit-url}</url> @@ -190,8 +190,6 @@ <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <maven.build.timestamp.format>yyyyMMddHHmm</maven.build.timestamp.format> <bundle-manifest>${project.build.directory}/META-INF/MANIFEST.MF</bundle-manifest> - <!-- set JDK_HOME to JAVA_HOME path of JDK7 installation in order to compile against JDK 7 class library --> - <JDK_HOME>${JAVA_HOME}</JDK_HOME> <jgit-last-release-version>4.2.0.201601211800-r</jgit-last-release-version> <jsch-version>0.1.53</jsch-version> @@ -263,11 +261,8 @@ <version>3.5.1</version> <configuration> <encoding>UTF-8</encoding> - <source>1.7</source> - <target>1.7</target> - <compilerArguments> - <bootclasspath>${JDK_HOME}${file.separator}jre${file.separator}lib${file.separator}rt.jar${path.separator}${JDK_HOME}${file.separator}jre${file.separator}lib${file.separator}jsse.jar${path.separator}${JDK_HOME}${file.separator}jre${file.separator}lib${file.separator}jce.jar</bootclasspath> - </compilerArguments> + <source>1.8</source> + <target>1.8</target> </configuration> </plugin> @@ -346,7 +341,7 @@ <configuration> <sourceEncoding>utf-8</sourceEncoding> <minimumTokens>100</minimumTokens> - <targetJdk>1.7</targetJdk> + <targetJdk>1.8</targetJdk> <format>xml</format> <failOnViolation>false</failOnViolation> </configuration> @@ -459,7 +454,7 @@ <quiet>true</quiet> <excludePackageNames>org.eclipse.jgit.http.test</excludePackageNames> <links> - <link>http://docs.oracle.com/javase/7/docs/api</link> + <link>http://docs.oracle.com/javase/8/docs/api</link> </links> </configuration> <executions> @@ -668,12 +663,6 @@ <profiles> <profile> - <id>jgit.java7</id> - <activation> - <jdk>[1.7,)</jdk> - </activation> - </profile> - <profile> <id>jgit.java8</id> <activation> <jdk>[1.8,)</jdk>
diff --git a/tools/eclipse-JGit-Format.xml b/tools/eclipse-JGit-Format.xml index 278b449..490758a 100644 --- a/tools/eclipse-JGit-Format.xml +++ b/tools/eclipse-JGit-Format.xml
@@ -45,7 +45,7 @@ <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/> <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/> -<setting id="org.eclipse.jdt.core.compiler.source" value="1.7"/> +<setting id="org.eclipse.jdt.core.compiler.source" value="1.8"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/> <setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="true"/> @@ -156,7 +156,7 @@ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="16"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/> -<setting id="org.eclipse.jdt.core.compiler.compliance" value="1.7"/> +<setting id="org.eclipse.jdt.core.compiler.compliance" value="1.8"/> <setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/> @@ -227,7 +227,7 @@ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/> <setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="insert"/> -<setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="1.7"/> +<setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="1.8"/> <setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/> <setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false"/> <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member" value="insert"/>