Merge branch 'stable-4.4'

* stable-4.4:
  Log if Repository.useCnt becomes negative
  Time based eviction strategy for repository cache
  Add method to read time unit from config
  Align include.path max depth with native git
  Config load should not fail on unsupported or nonexistent include path
  Allow using JDK 7 bootclasspath when compiling JGit using Java 8
  Extract work queue to allow reusing it

Change-Id: I6aeedb1cb8b0c3068af344a719c80a03ae68fc23
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
diff --git a/org.eclipse.jgit.ant.test/META-INF/MANIFEST.MF b/org.eclipse.jgit.ant.test/META-INF/MANIFEST.MF
index d497bc0..6ddc85d 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.4.1.qualifier
+Bundle-Version: 4.5.0.qualifier
 Bundle-ActivationPolicy: lazy
 Bundle-RequiredExecutionEnvironment: JavaSE-1.7
 Import-Package: org.apache.tools.ant,
- org.eclipse.jgit.ant.tasks;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.internal.storage.file;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.junit;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.lib;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.util;version="[4.4.1,4.5.0)",
+ org.eclipse.jgit.ant.tasks;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.internal.storage.file;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.junit;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.lib;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.util;version="[4.5.0,4.6.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/pom.xml b/org.eclipse.jgit.ant.test/pom.xml
index 34d8305..a35f8ae 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.4.1-SNAPSHOT</version>
+    <version>4.5.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>org.eclipse.jgit.ant.test</artifactId>
diff --git a/org.eclipse.jgit.ant/META-INF/MANIFEST.MF b/org.eclipse.jgit.ant/META-INF/MANIFEST.MF
index 9c9c575..3682564 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.4.1.qualifier
+Bundle-Version: 4.5.0.qualifier
 Bundle-RequiredExecutionEnvironment: JavaSE-1.7
 Import-Package: org.apache.tools.ant,
-  org.eclipse.jgit.storage.file;version="[4.4.1,4.5.0)"
+  org.eclipse.jgit.storage.file;version="[4.5.0,4.6.0)"
 Bundle-Localization: plugin
 Bundle-Vendor: %Provider-Name
-Export-Package: org.eclipse.jgit.ant.tasks;version="4.4.1";
+Export-Package: org.eclipse.jgit.ant.tasks;version="4.5.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 ae150f2..735f76a 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.4.1-SNAPSHOT</version>
+		<version>4.5.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>org.eclipse.jgit.ant</artifactId>
diff --git a/org.eclipse.jgit.archive/META-INF/MANIFEST.MF b/org.eclipse.jgit.archive/META-INF/MANIFEST.MF
index 813dd51..1c77b98 100644
--- a/org.eclipse.jgit.archive/META-INF/MANIFEST.MF
+++ b/org.eclipse.jgit.archive/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %plugin_name
 Bundle-SymbolicName: org.eclipse.jgit.archive
-Bundle-Version: 4.4.1.qualifier
+Bundle-Version: 4.5.0.qualifier
 Bundle-Vendor: %provider_name
 Bundle-Localization: plugin
 Bundle-RequiredExecutionEnvironment: JavaSE-1.7
@@ -12,14 +12,14 @@
  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.4.1,4.5.0)",
- org.eclipse.jgit.lib;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.nls;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.util;version="[4.4.1,4.5.0)",
+ org.eclipse.jgit.api;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.lib;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.nls;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.util;version="[4.5.0,4.6.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.4.1";
+Export-Package: org.eclipse.jgit.archive;version="4.5.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 f64b4cd..38a2298 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.4.1.qualifier
-Eclipse-SourceBundle: org.eclipse.jgit.archive;version="4.4.1.qualifier";roots="."
+Bundle-Version: 4.5.0.qualifier
+Eclipse-SourceBundle: org.eclipse.jgit.archive;version="4.5.0.qualifier";roots="."
diff --git a/org.eclipse.jgit.archive/pom.xml b/org.eclipse.jgit.archive/pom.xml
index 9b635fc..14b6f49 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.4.1-SNAPSHOT</version>
+    <version>4.5.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>org.eclipse.jgit.archive</artifactId>
diff --git a/org.eclipse.jgit.http.apache/META-INF/MANIFEST.MF b/org.eclipse.jgit.http.apache/META-INF/MANIFEST.MF
index 66e0839..72865ab 100644
--- a/org.eclipse.jgit.http.apache/META-INF/MANIFEST.MF
+++ b/org.eclipse.jgit.http.apache/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %Bundle-Name
 Bundle-SymbolicName: org.eclipse.jgit.http.apache
-Bundle-Version: 4.4.1.qualifier
+Bundle-Version: 4.5.0.qualifier
 Bundle-RequiredExecutionEnvironment: JavaSE-1.7
 Bundle-Localization: plugin
 Bundle-Vendor: %Provider-Name
@@ -19,10 +19,10 @@
  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.4.1,4.5.0)",
- org.eclipse.jgit.transport.http;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.util;version="[4.4.1,4.5.0)"
-Export-Package: org.eclipse.jgit.transport.http.apache;version="4.4.1";
+ org.eclipse.jgit.nls;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.transport.http;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.util;version="[4.5.0,4.6.0)"
+Export-Package: org.eclipse.jgit.transport.http.apache;version="4.5.0";
   uses:="org.eclipse.jgit.transport.http,
    javax.net.ssl,
    org.apache.http.client,
diff --git a/org.eclipse.jgit.http.apache/pom.xml b/org.eclipse.jgit.http.apache/pom.xml
index 33292d7..b1e5c87 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.4.1-SNAPSHOT</version>
+		<version>4.5.0-SNAPSHOT</version>
 	</parent>
 
 	<artifactId>org.eclipse.jgit.http.apache</artifactId>
diff --git a/org.eclipse.jgit.http.server/META-INF/MANIFEST.MF b/org.eclipse.jgit.http.server/META-INF/MANIFEST.MF
index fb590ce..cf5ec14 100644
--- a/org.eclipse.jgit.http.server/META-INF/MANIFEST.MF
+++ b/org.eclipse.jgit.http.server/META-INF/MANIFEST.MF
@@ -2,13 +2,13 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %plugin_name
 Bundle-SymbolicName: org.eclipse.jgit.http.server
-Bundle-Version: 4.4.1.qualifier
+Bundle-Version: 4.5.0.qualifier
 Bundle-Localization: plugin
 Bundle-Vendor: %provider_name
-Export-Package: org.eclipse.jgit.http.server;version="4.4.1",
- org.eclipse.jgit.http.server.glue;version="4.4.1";
+Export-Package: org.eclipse.jgit.http.server;version="4.5.0",
+ org.eclipse.jgit.http.server.glue;version="4.5.0";
   uses:="javax.servlet,javax.servlet.http",
- org.eclipse.jgit.http.server.resolver;version="4.4.1";
+ org.eclipse.jgit.http.server.resolver;version="4.5.0";
   uses:="org.eclipse.jgit.transport.resolver,
    org.eclipse.jgit.lib,
    org.eclipse.jgit.transport,
@@ -17,12 +17,12 @@
 Bundle-RequiredExecutionEnvironment: JavaSE-1.7
 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.4.1,4.5.0)",
- org.eclipse.jgit.internal.storage.dfs;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.internal.storage.file;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.lib;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.nls;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.revwalk;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.transport;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.transport.resolver;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.util;version="[4.4.1,4.5.0)"
+ org.eclipse.jgit.errors;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.internal.storage.dfs;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.internal.storage.file;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.lib;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.nls;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.revwalk;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.transport;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.transport.resolver;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.util;version="[4.5.0,4.6.0)"
diff --git a/org.eclipse.jgit.http.server/pom.xml b/org.eclipse.jgit.http.server/pom.xml
index e507291..a344bae 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.4.1-SNAPSHOT</version>
+    <version>4.5.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>org.eclipse.jgit.http.server</artifactId>
diff --git a/org.eclipse.jgit.http.test/META-INF/MANIFEST.MF b/org.eclipse.jgit.http.test/META-INF/MANIFEST.MF
index 817759a..35bb383 100644
--- a/org.eclipse.jgit.http.test/META-INF/MANIFEST.MF
+++ b/org.eclipse.jgit.http.test/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %plugin_name
 Bundle-SymbolicName: org.eclipse.jgit.http.test
-Bundle-Version: 4.4.1.qualifier
+Bundle-Version: 4.5.0.qualifier
 Bundle-Vendor: %provider_name
 Bundle-Localization: plugin
 Bundle-RequiredExecutionEnvironment: JavaSE-1.7
@@ -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.4.1,4.5.0)",
- org.eclipse.jgit.http.server;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.http.server.glue;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.http.server.resolver;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.internal;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.internal.storage.dfs;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.internal.storage.file;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.junit;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.junit.http;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.lib;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.nls;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.revwalk;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.storage.file;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.transport;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.transport.http;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.transport.http.apache;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.transport.resolver;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.util;version="[4.4.1,4.5.0)",
+ org.eclipse.jgit.errors;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.http.server;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.http.server.glue;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.http.server.resolver;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.internal;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.internal.storage.dfs;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.internal.storage.file;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.junit;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.junit.http;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.lib;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.nls;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.revwalk;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.storage.file;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.transport;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.transport.http;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.transport.http.apache;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.transport.resolver;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.util;version="[4.5.0,4.6.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 814b41c..1a728a0 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.4.1-SNAPSHOT</version>
+    <version>4.5.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>org.eclipse.jgit.http.test</artifactId>
diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java
index 073c751..2b9105c 100644
--- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java
+++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java
@@ -610,7 +610,7 @@ public void testPush_CreateBranch() throws Exception {
 		fsck(remoteRepository, Q);
 
 		final ReflogReader log = remoteRepository.getReflogReader(dstName);
-		assertNotNull("has log for " + dstName);
+		assertNotNull("has log for " + dstName, log);
 
 		final ReflogEntry last = log.getLastEntry();
 		assertNotNull("has last entry", last);
diff --git a/org.eclipse.jgit.junit.http/META-INF/MANIFEST.MF b/org.eclipse.jgit.junit.http/META-INF/MANIFEST.MF
index ed6ab6b..3b306ef 100644
--- a/org.eclipse.jgit.junit.http/META-INF/MANIFEST.MF
+++ b/org.eclipse.jgit.junit.http/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %plugin_name
 Bundle-SymbolicName: org.eclipse.jgit.junit.http
-Bundle-Version: 4.4.1.qualifier
+Bundle-Version: 4.5.0.qualifier
 Bundle-Localization: plugin
 Bundle-Vendor: %provider_name
 Bundle-ActivationPolicy: lazy
@@ -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.4.1,4.5.0)",
- org.eclipse.jgit.http.server;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.internal.storage.file;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.junit;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.lib;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.revwalk;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.transport;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.transport.resolver;version="[4.4.1,4.5.0)",
+ org.eclipse.jgit.errors;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.http.server;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.internal.storage.file;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.junit;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.lib;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.revwalk;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.transport;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.transport.resolver;version="[4.5.0,4.6.0)",
  org.junit;version="[4.0.0,5.0.0)"
-Export-Package: org.eclipse.jgit.junit.http;version="4.4.1";
+Export-Package: org.eclipse.jgit.junit.http;version="4.5.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 31db5d1..1f8f39f 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.4.1-SNAPSHOT</version>
+    <version>4.5.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 c36c297..c885740 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
@@ -181,6 +181,14 @@ protected UserIdentity loadUser(String who) {
 			protected void loadUsers() throws IOException {
 				putUser(username, new Password(password), new String[] { role });
 			}
+
+			protected String[] loadRoleInfo(KnownUser user) {
+				return null;
+			}
+
+			protected KnownUser loadUserInfo(String usrname) {
+				return null;
+			}
 		};
 
 		ConstraintMapping cm = new ConstraintMapping();
diff --git a/org.eclipse.jgit.junit/META-INF/MANIFEST.MF b/org.eclipse.jgit.junit/META-INF/MANIFEST.MF
index cb38f91..8a010fc 100644
--- a/org.eclipse.jgit.junit/META-INF/MANIFEST.MF
+++ b/org.eclipse.jgit.junit/META-INF/MANIFEST.MF
@@ -2,27 +2,27 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %plugin_name
 Bundle-SymbolicName: org.eclipse.jgit.junit
-Bundle-Version: 4.4.1.qualifier
+Bundle-Version: 4.5.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.4.1,4.5.0)",
- org.eclipse.jgit.api.errors;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.dircache;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.errors;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.internal.storage.file;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.internal.storage.pack;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.lib;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.merge;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.revwalk;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.storage.file;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.treewalk;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.treewalk.filter;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.util;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.util.io;version="[4.4.1,4.5.0)",
+Import-Package: org.eclipse.jgit.api;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.api.errors;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.dircache;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.errors;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.internal.storage.file;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.internal.storage.pack;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.lib;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.merge;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.revwalk;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.storage.file;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.treewalk;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.treewalk.filter;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.util;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.util.io;version="[4.5.0,4.6.0)",
  org.junit;version="[4.0.0,5.0.0)"
-Export-Package: org.eclipse.jgit.junit;version="4.4.1";
+Export-Package: org.eclipse.jgit.junit;version="4.5.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 ef634a6..ec7baab 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.4.1-SNAPSHOT</version>
+    <version>4.5.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>org.eclipse.jgit.junit</artifactId>
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 8a8f048..f9cfd8f 100644
--- a/org.eclipse.jgit.lfs.server.test/META-INF/MANIFEST.MF
+++ b/org.eclipse.jgit.lfs.server.test/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %plugin_name
 Bundle-SymbolicName: org.eclipse.jgit.lfs.server.test
-Bundle-Version: 4.4.1.qualifier
+Bundle-Version: 4.5.0.qualifier
 Bundle-Vendor: %provider_name
 Bundle-Localization: plugin
 Bundle-RequiredExecutionEnvironment: JavaSE-1.7
@@ -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.4.1,4.5.0)",
- org.eclipse.jgit.lfs.lib;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.lfs.server.fs;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.lfs.test;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.util;version="[4.4.1,4.5.0)",
+ org.eclipse.jgit.junit.http;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.lfs.lib;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.lfs.server.fs;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.lfs.test;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.util;version="[4.5.0,4.6.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 d45852f..02096bb 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.4.1-SNAPSHOT</version>
+    <version>4.5.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>org.eclipse.jgit.lfs.server.test</artifactId>
diff --git a/org.eclipse.jgit.lfs.server/META-INF/MANIFEST.MF b/org.eclipse.jgit.lfs.server/META-INF/MANIFEST.MF
index c2bf206..a97194d 100644
--- a/org.eclipse.jgit.lfs.server/META-INF/MANIFEST.MF
+++ b/org.eclipse.jgit.lfs.server/META-INF/MANIFEST.MF
@@ -2,19 +2,19 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %plugin_name
 Bundle-SymbolicName: org.eclipse.jgit.lfs.server
-Bundle-Version: 4.4.1.qualifier
+Bundle-Version: 4.5.0.qualifier
 Bundle-Localization: plugin
 Bundle-Vendor: %provider_name
-Export-Package: org.eclipse.jgit.lfs.server;version="4.4.1";
+Export-Package: org.eclipse.jgit.lfs.server;version="4.5.0";
   uses:="javax.servlet.http,
    org.eclipse.jgit.lfs.lib",
- org.eclipse.jgit.lfs.server.fs;version="4.4.1";
+ org.eclipse.jgit.lfs.server.fs;version="4.5.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.4.1";x-internal:=true,
- org.eclipse.jgit.lfs.server.s3;version="4.4.1";
+ org.eclipse.jgit.lfs.server.internal;version="4.5.0";x-internal:=true,
+ org.eclipse.jgit.lfs.server.s3;version="4.5.0";
   uses:="org.eclipse.jgit.lfs.server,
    org.eclipse.jgit.lfs.lib"
 Bundle-RequiredExecutionEnvironment: JavaSE-1.7
@@ -24,12 +24,12 @@
  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.4.1,4.5.0)",
- org.eclipse.jgit.internal;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.internal.storage.file;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.lfs.errors;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.lfs.lib;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.nls;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.transport.http;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.transport.http.apache;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.util;version="[4.4.1,4.5.0)"
+ org.eclipse.jgit.annotations;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.internal;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.internal.storage.file;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.lfs.errors;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.lfs.lib;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.nls;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.transport.http;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.transport.http.apache;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.util;version="[4.5.0,4.6.0)"
diff --git a/org.eclipse.jgit.lfs.server/pom.xml b/org.eclipse.jgit.lfs.server/pom.xml
index a886a92..7956db0 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.4.1-SNAPSHOT</version>
+    <version>4.5.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 451064d..f97acac 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
@@ -2,11 +2,11 @@
 failedToCalcSignature=Failed to calculate a request signature: {0}
 invalidPathInfo=Invalid pathInfo ''{0}'' does not match ''/'{'SHA-256'}'''
 objectNotFound=Object ''{0}'' not found
-undefinedS3AccessKey=S3 configuration: ''accessKey'' is undefined
-undefinedS3Bucket=S3 configuration: ''bucket'' is undefined
-undefinedS3Region=S3 configuration: ''region'' is undefined
-undefinedS3SecretKey=S3 configuration: ''secretKey'' is undefined
-undefinedS3StorageClass=S3 configuration: ''storageClass'' is undefined
+undefinedS3AccessKey=S3 configuration: 'accessKey' is undefined
+undefinedS3Bucket=S3 configuration: 'bucket' is undefined
+undefinedS3Region=S3 configuration: 'region' is undefined
+undefinedS3SecretKey=S3 configuration: 'secretKey' is undefined
+undefinedS3StorageClass=S3 configuration: 'storageClass' is undefined
 unparsableEndpoint=Unable to parse service endpoint: {0}
 unsupportedOperation=Operation ''{0}'' is not supported
 unsupportedUtf8=UTF-8 encoding is not supported.
diff --git a/org.eclipse.jgit.lfs.test/META-INF/MANIFEST.MF b/org.eclipse.jgit.lfs.test/META-INF/MANIFEST.MF
index 30e1029..0fb141c 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.4.1.qualifier
+Bundle-Version: 4.5.0.qualifier
 Bundle-Vendor: %provider_name
 Bundle-Localization: plugin
 Bundle-RequiredExecutionEnvironment: JavaSE-1.7
-Import-Package: org.eclipse.jgit.junit;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.lfs.errors;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.lfs.lib;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.lib;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.util;version="[4.4.1,4.5.0)",
+Import-Package: org.eclipse.jgit.junit;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.lfs.errors;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.lfs.lib;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.lib;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.util;version="[4.5.0,4.6.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.4.1";x-friends:="org.eclipse.jgit.lfs.server.test"
+Export-Package: org.eclipse.jgit.lfs.test;version="4.5.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 faae427..7fd4074 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.4.1-SNAPSHOT</version>
+    <version>4.5.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>org.eclipse.jgit.lfs.test</artifactId>
diff --git a/org.eclipse.jgit.lfs/META-INF/MANIFEST.MF b/org.eclipse.jgit.lfs/META-INF/MANIFEST.MF
index c0abe02..09580f3 100644
--- a/org.eclipse.jgit.lfs/META-INF/MANIFEST.MF
+++ b/org.eclipse.jgit.lfs/META-INF/MANIFEST.MF
@@ -2,14 +2,14 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %plugin_name
 Bundle-SymbolicName: org.eclipse.jgit.lfs
-Bundle-Version: 4.4.1.qualifier
+Bundle-Version: 4.5.0.qualifier
 Bundle-Localization: plugin
 Bundle-Vendor: %provider_name
-Export-Package: org.eclipse.jgit.lfs.errors;version="4.4.1",
- org.eclipse.jgit.lfs.internal;version="4.4.1";x-friends:="org.eclipse.jgit.lfs.test",
- org.eclipse.jgit.lfs.lib;version="4.4.1"
+Export-Package: org.eclipse.jgit.lfs.errors;version="4.5.0",
+ org.eclipse.jgit.lfs.internal;version="4.5.0";x-friends:="org.eclipse.jgit.lfs.test",
+ org.eclipse.jgit.lfs.lib;version="4.5.0"
 Bundle-RequiredExecutionEnvironment: JavaSE-1.7
-Import-Package: org.eclipse.jgit.internal.storage.file;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.lib;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.nls;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.util;version="[4.4.1,4.5.0)"
+Import-Package: org.eclipse.jgit.internal.storage.file;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.lib;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.nls;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.util;version="[4.5.0,4.6.0)"
diff --git a/org.eclipse.jgit.lfs/pom.xml b/org.eclipse.jgit.lfs/pom.xml
index 9a7dfea..94ad085 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.4.1-SNAPSHOT</version>
+    <version>4.5.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>org.eclipse.jgit.lfs</artifactId>
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 9d99466..869c922 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.4.1.qualifier"
+      version="4.5.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 248be52..9a7d976 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.4.1-SNAPSHOT</version>
+    <version>4.5.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 01e5d9d..3c3125b 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.4.1.qualifier"
+      version="4.5.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 06b497b..68c569f 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.4.1-SNAPSHOT</version>
+    <version>4.5.0-SNAPSHOT</version>
   </parent>
 
   <groupId>org.eclipse.jgit.feature</groupId>
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 aee0afa..2821f69 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.4.1.qualifier"
+      version="4.5.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 5947dc3..55a50a0 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.4.1-SNAPSHOT</version>
+    <version>4.5.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 014c16f..fba7815 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.4.1.qualifier"
+      version="4.5.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 de79b22..01fc1b4 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.4.1-SNAPSHOT</version>
+    <version>4.5.0-SNAPSHOT</version>
   </parent>
 
   <groupId>org.eclipse.jgit.feature</groupId>
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 036aabb..18410fc 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.4.1.qualifier"
+      version="4.5.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.4.1" match="equivalent"/>
-      <import feature="org.eclipse.jgit.lfs" version="4.4.1" match="equivalent"/>
+      <import feature="org.eclipse.jgit" version="4.5.0" match="equivalent"/>
+      <import feature="org.eclipse.jgit.lfs" version="4.5.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 024be50..39c915e 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.4.1-SNAPSHOT</version>
+    <version>4.5.0-SNAPSHOT</version>
   </parent>
 
   <groupId>org.eclipse.jgit.feature</groupId>
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 d63eb50..34b4a39 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.4.1.qualifier"
+      version="4.5.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 6864fe0..e5cc121 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.4.1-SNAPSHOT</version>
+    <version>4.5.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 c2bfc92..15d10e6 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,6 @@
    <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>
-   <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">
       <description>
          JGit
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 b200edb..2c05c94 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.4.1-SNAPSHOT</version>
+    <version>4.5.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 246f227..1ccd7bb 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.4.1.qualifier"
+      version="4.5.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 2db8948..f88073b 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.4.1-SNAPSHOT</version>
+    <version>4.5.0-SNAPSHOT</version>
   </parent>
 
   <groupId>org.eclipse.jgit.feature</groupId>
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 b5fbc82..88509ac 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.4.1.qualifier
+Bundle-Version: 4.5.0.qualifier
diff --git a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.6.target b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.6.target
index f7d5622..a1f5abf 100644
--- a/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.6.target
+++ b/org.eclipse.jgit.packaging/org.eclipse.jgit.target/jgit-4.6.target
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
 <?pde?>
 <!-- generated with https://github.com/mbarbero/fr.obeo.releng.targetplatform -->
-<target name="jgit-4.6" sequenceNumber="1463612069">
+<target name="jgit-4.6" sequenceNumber="1465553981">
   <locations>
     <location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
       <unit id="org.eclipse.jetty.client" version="9.2.13.v20150730"/>
@@ -58,7 +58,7 @@
       <unit id="org.slf4j.api.source" version="1.7.2.v20121108-1250"/>
       <unit id="org.slf4j.impl.log4j12" version="1.7.2.v20131105-2200"/>
       <unit id="org.slf4j.impl.log4j12.source" version="1.7.2.v20131105-2200"/>
-      <repository location="http://download.eclipse.org/tools/orbit/downloads/drops/S20160518051658/repository/"/>
+      <repository location="http://download.eclipse.org/tools/orbit/downloads/drops/R20160520211859/repository/"/>
     </location>
     <location includeMode="slicer" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="true" type="InstallableUnit">
       <unit id="org.eclipse.osgi" version="0.0.0"/>
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 d991f7e..cf0234a 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.4.1-SNAPSHOT</version>
+    <version>4.5.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 d0117db..5b2e3da 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.4.1-SNAPSHOT</version>
+  <version>4.5.0-SNAPSHOT</version>
   <packaging>pom</packaging>
 
   <name>JGit Tycho Parent</name>
diff --git a/org.eclipse.jgit.pgm.test/META-INF/MANIFEST.MF b/org.eclipse.jgit.pgm.test/META-INF/MANIFEST.MF
index 5022b7f..808541a 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.4.1.qualifier
+Bundle-Version: 4.5.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.4.1,4.5.0)",
- org.eclipse.jgit.api.errors;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.diff;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.dircache;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.internal.storage.file;version="4.4.1",
- org.eclipse.jgit.junit;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.lib;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.merge;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.pgm;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.pgm.internal;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.pgm.opt;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.revwalk;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.storage.file;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.transport;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.treewalk;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.util;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.util.io;version="[4.4.1,4.5.0)",
+Import-Package: org.eclipse.jgit.api;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.api.errors;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.diff;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.dircache;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.internal.storage.file;version="4.5.0",
+ org.eclipse.jgit.junit;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.lib;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.merge;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.pgm;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.pgm.internal;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.pgm.opt;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.revwalk;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.storage.file;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.transport;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.treewalk;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.util;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.util.io;version="[4.5.0,4.6.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/pom.xml b/org.eclipse.jgit.pgm.test/pom.xml
index 56e5ea5..11039bb 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.4.1-SNAPSHOT</version>
+    <version>4.5.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>org.eclipse.jgit.pgm.test</artifactId>
diff --git a/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/CheckoutTest.java b/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/CheckoutTest.java
index e690ad6..3651542 100644
--- a/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/CheckoutTest.java
+++ b/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/CheckoutTest.java
@@ -47,6 +47,7 @@
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 import java.io.File;
 import java.nio.file.Files;
@@ -236,8 +237,8 @@ public void testCheckoutOrphan() throws Exception {
 	 * <li>Checkout branch '1'
 	 * </ol>
 	 * <p>
-	 * The working tree should contain 'a' with FileMode.REGULAR_FILE after the
-	 * checkout.
+	 * The checkout has to delete folder but the workingtree contains a dirty
+	 * file at this path. The checkout should fail like in native git.
 	 *
 	 * @throws Exception
 	 */
@@ -266,11 +267,15 @@ public void fileModeTestMissingThenFolderWithFileInWorkingTree()
 					db.getFS());
 			assertEquals(FileMode.REGULAR_FILE, entry.getMode());
 
-			git.checkout().setName(branch_1.getName()).call();
-
-			entry = new FileTreeIterator.FileEntry(new File(db.getWorkTree(), "a"),
-					db.getFS());
-			assertEquals(FileMode.REGULAR_FILE, entry.getMode());
+			try {
+				git.checkout().setName(branch_1.getName()).call();
+				fail("Don't get the expected conflict");
+			} catch (CheckoutConflictException e) {
+				assertEquals("[a]", e.getConflictingPaths().toString());
+				entry = new FileTreeIterator.FileEntry(
+						new File(db.getWorkTree(), "a"), db.getFS());
+				assertEquals(FileMode.REGULAR_FILE, entry.getMode());
+			}
 		}
 	}
 
diff --git a/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/CloneTest.java b/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/CloneTest.java
index fe80388..2c0abd7 100644
--- a/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/CloneTest.java
+++ b/org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/CloneTest.java
@@ -135,6 +135,7 @@ public void testCloneIntoCurrentDir() throws Exception {
 		assertEquals("expected 1 branch", 1, branches.size());
 	}
 
+	@Test
 	public void testCloneBare() throws Exception {
 		createInitialCommit();
 
diff --git a/org.eclipse.jgit.pgm/META-INF/MANIFEST.MF b/org.eclipse.jgit.pgm/META-INF/MANIFEST.MF
index 7e200ac..1c61f7c 100644
--- a/org.eclipse.jgit.pgm/META-INF/MANIFEST.MF
+++ b/org.eclipse.jgit.pgm/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %plugin_name
 Bundle-SymbolicName: org.eclipse.jgit.pgm
-Bundle-Version: 4.4.1.qualifier
+Bundle-Version: 4.5.0.qualifier
 Bundle-Vendor: %provider_name
 Bundle-ActivationPolicy: lazy
 Bundle-Localization: plugin
@@ -26,45 +26,45 @@
  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.4.1,4.5.0)",
- org.eclipse.jgit.api.errors;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.archive;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.awtui;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.blame;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.diff;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.dircache;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.errors;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.gitrepo;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.internal.ketch;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.internal.storage.file;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.internal.storage.pack;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.internal.storage.reftree;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.lfs.lib;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.lfs.server;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.lfs.server.fs;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.lfs.server.s3;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.lib;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.merge;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.nls;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.notes;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.revplot;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.revwalk;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.revwalk.filter;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.storage.file;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.storage.pack;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.transport;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.transport.http.apache;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.transport.resolver;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.treewalk;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.treewalk.filter;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.util;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.util.io;version="[4.4.1,4.5.0)",
+ org.eclipse.jgit.api;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.api.errors;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.archive;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.awtui;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.blame;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.diff;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.dircache;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.errors;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.gitrepo;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.internal.ketch;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.internal.storage.file;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.internal.storage.pack;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.internal.storage.reftree;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.lfs.lib;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.lfs.server;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.lfs.server.fs;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.lfs.server.s3;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.lib;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.merge;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.nls;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.notes;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.revplot;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.revwalk;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.revwalk.filter;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.storage.file;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.storage.pack;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.transport;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.transport.http.apache;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.transport.resolver;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.treewalk;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.treewalk.filter;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.util;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.util.io;version="[4.5.0,4.6.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.4.1";
+Export-Package: org.eclipse.jgit.console;version="4.5.0";
   uses:="org.eclipse.jgit.transport,
    org.eclipse.jgit.util",
- org.eclipse.jgit.pgm;version="4.4.1";
+ org.eclipse.jgit.pgm;version="4.5.0";
   uses:="org.eclipse.jgit.revwalk,
    org.eclipse.jgit.treewalk.filter,
    org.eclipse.jgit.pgm.opt,
@@ -75,11 +75,11 @@
    org.eclipse.jgit.treewalk,
    javax.swing,
    org.eclipse.jgit.transport",
- org.eclipse.jgit.pgm.debug;version="4.4.1";
+ org.eclipse.jgit.pgm.debug;version="4.5.0";
   uses:="org.eclipse.jgit.util.io,
    org.eclipse.jgit.pgm",
- org.eclipse.jgit.pgm.internal;version="4.4.1";x-friends:="org.eclipse.jgit.pgm.test,org.eclipse.jgit.test",
- org.eclipse.jgit.pgm.opt;version="4.4.1";
+ org.eclipse.jgit.pgm.internal;version="4.5.0";x-friends:="org.eclipse.jgit.pgm.test,org.eclipse.jgit.test",
+ org.eclipse.jgit.pgm.opt;version="4.5.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 e660855..f803d3a 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.4.1.qualifier
-Eclipse-SourceBundle: org.eclipse.jgit.pgm;version="4.4.1.qualifier";roots="."
+Bundle-Version: 4.5.0.qualifier
+Eclipse-SourceBundle: org.eclipse.jgit.pgm;version="4.5.0.qualifier";roots="."
diff --git a/org.eclipse.jgit.pgm/pom.xml b/org.eclipse.jgit.pgm/pom.xml
index 902d4e7..8ccd2de 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.4.1-SNAPSHOT</version>
+    <version>4.5.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>org.eclipse.jgit.pgm</artifactId>
diff --git a/org.eclipse.jgit.test/META-INF/MANIFEST.MF b/org.eclipse.jgit.test/META-INF/MANIFEST.MF
index f11301e..a4a3368 100644
--- a/org.eclipse.jgit.test/META-INF/MANIFEST.MF
+++ b/org.eclipse.jgit.test/META-INF/MANIFEST.MF
@@ -2,52 +2,52 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %plugin_name
 Bundle-SymbolicName: org.eclipse.jgit.test
-Bundle-Version: 4.4.1.qualifier
+Bundle-Version: 4.5.0.qualifier
 Bundle-Localization: plugin
 Bundle-Vendor: %provider_name
 Bundle-ActivationPolicy: lazy
 Bundle-RequiredExecutionEnvironment: JavaSE-1.7
 Import-Package: com.googlecode.javaewah;version="[0.7.9,0.8.0)",
- org.eclipse.jgit.api;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.api.errors;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.attributes;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.awtui;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.blame;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.diff;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.dircache;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.errors;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.events;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.fnmatch;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.gitrepo;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.hooks;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.ignore;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.ignore.internal;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.internal;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.internal.storage.dfs;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.internal.storage.file;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.internal.storage.pack;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.internal.storage.reftree;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.junit;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.lib;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.merge;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.nls;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.notes;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.patch;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.pgm;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.pgm.internal;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.revplot;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.revwalk;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.revwalk.filter;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.storage.file;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.storage.pack;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.submodule;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.transport;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.transport.http;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.transport.resolver;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.treewalk;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.treewalk.filter;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.util;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.util.io;version="[4.4.1,4.5.0)",
+ org.eclipse.jgit.api;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.api.errors;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.attributes;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.awtui;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.blame;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.diff;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.dircache;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.errors;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.events;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.fnmatch;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.gitrepo;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.hooks;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.ignore;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.ignore.internal;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.internal;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.internal.storage.dfs;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.internal.storage.file;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.internal.storage.pack;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.internal.storage.reftree;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.junit;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.lib;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.merge;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.nls;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.notes;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.patch;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.pgm;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.pgm.internal;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.revplot;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.revwalk;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.revwalk.filter;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.storage.file;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.storage.pack;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.submodule;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.transport;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.transport.http;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.transport.resolver;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.treewalk;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.treewalk.filter;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.util;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.util.io;version="[4.5.0,4.6.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/pom.xml b/org.eclipse.jgit.test/pom.xml
index f038ab6..38e2257 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.4.1-SNAPSHOT</version>
+    <version>4.5.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>org.eclipse.jgit.test</artifactId>
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 126ca5c..42601aa 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
@@ -45,7 +45,6 @@
 
 import static org.eclipse.jgit.util.FileUtils.RECURSIVE;
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
@@ -136,6 +135,29 @@ public void testCleanFilter() throws IOException,
 	}
 
 	@Test
+	public void testAttributesWithTreeWalkFilter()
+			throws IOException, GitAPIException {
+		writeTrashFile(".gitattributes", "*.txt filter=lfs");
+		writeTrashFile("src/a.tmp", "foo");
+		writeTrashFile("src/a.txt", "foo\n");
+		File script = writeTempFile("sed s/o/e/g");
+
+		try (Git git = new Git(db)) {
+			StoredConfig config = git.getRepository().getConfig();
+			config.setString("filter", "lfs", "clean",
+					"sh " + slashify(script.getPath()));
+			config.save();
+
+			git.add().addFilepattern(".gitattributes").call();
+			git.commit().setMessage("attr").call();
+			git.add().addFilepattern("src/a.txt").addFilepattern("src/a.tmp")
+					.addFilepattern(".gitattributes").call();
+			git.commit().setMessage("c1").call();
+			assertTrue(git.status().call().isClean());
+		}
+	}
+
+	@Test
 	public void testCleanFilterEnvironment()
 			throws IOException, GitAPIException {
 		writeTrashFile(".gitattributes", "*.txt filter=tstFilter");
@@ -932,7 +954,11 @@ protected File discoverGitExe() {
 			}
 
 			public boolean canExecute(File f) {
-				return true;
+				try {
+					return read(f).startsWith("binary:");
+				} catch (IOException e) {
+					return false;
+				}
 			}
 
 			@Override
@@ -943,61 +969,40 @@ public boolean isCaseSensitive() {
 
 		Git git = Git.open(db.getDirectory(), executableFs);
 		String path = "a.txt";
+		String path2 = "a.sh";
 		writeTrashFile(path, "content");
-		git.add().addFilepattern(path).call();
+		writeTrashFile(path2, "binary: content");
+		git.add().addFilepattern(path).addFilepattern(path2).call();
 		RevCommit commit1 = git.commit().setMessage("commit").call();
-		TreeWalk walk = TreeWalk.forPath(db, path, commit1.getTree());
-		assertNotNull(walk);
-		assertEquals(FileMode.EXECUTABLE_FILE, walk.getFileMode(0));
-
-		FS nonExecutableFs = new FS() {
-
-			public boolean supportsExecute() {
-				return false;
-			}
-
-			public boolean setExecute(File f, boolean canExec) {
-				return false;
-			}
-
-			public ProcessBuilder runInShell(String cmd, String[] args) {
-				return null;
-			}
-
-			public boolean retryFailedLockFileCommit() {
-				return false;
-			}
-
-			public FS newInstance() {
-				return this;
-			}
-
-			protected File discoverGitExe() {
-				return null;
-			}
-
-			public boolean canExecute(File f) {
-				return false;
-			}
-
-			@Override
-			public boolean isCaseSensitive() {
-				return false;
-			}
-		};
+		try (TreeWalk walk = new TreeWalk(db)) {
+			walk.addTree(commit1.getTree());
+			walk.next();
+			assertEquals(path2, walk.getPathString());
+			assertEquals(FileMode.EXECUTABLE_FILE, walk.getFileMode(0));
+			walk.next();
+			assertEquals(path, walk.getPathString());
+			assertEquals(FileMode.REGULAR_FILE, walk.getFileMode(0));
+		}
 
 		config = db.getConfig();
 		config.setBoolean(ConfigConstants.CONFIG_CORE_SECTION, null,
 				ConfigConstants.CONFIG_KEY_FILEMODE, false);
 		config.save();
 
-		Git git2 = Git.open(db.getDirectory(), nonExecutableFs);
-		writeTrashFile(path, "content2");
-		git2.add().addFilepattern(path).call();
+		Git git2 = Git.open(db.getDirectory(), executableFs);
+		writeTrashFile(path2, "content2");
+		writeTrashFile(path, "binary: content2");
+		git2.add().addFilepattern(path).addFilepattern(path2).call();
 		RevCommit commit2 = git2.commit().setMessage("commit2").call();
-		walk = TreeWalk.forPath(db, path, commit2.getTree());
-		assertNotNull(walk);
-		assertEquals(FileMode.EXECUTABLE_FILE, walk.getFileMode(0));
+		try (TreeWalk walk = new TreeWalk(db)) {
+			walk.addTree(commit2.getTree());
+			walk.next();
+			assertEquals(path2, walk.getPathString());
+			assertEquals(FileMode.EXECUTABLE_FILE, walk.getFileMode(0));
+			walk.next();
+			assertEquals(path, walk.getPathString());
+			assertEquals(FileMode.REGULAR_FILE, walk.getFileMode(0));
+		}
 	}
 
 	@Test
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/PathCheckoutCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/PathCheckoutCommandTest.java
index 3343af0..1250773 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/PathCheckoutCommandTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/PathCheckoutCommandTest.java
@@ -271,6 +271,7 @@ public static void validateIndex(Git git) throws NoWorkTreeException,
 		}
 	}
 
+	@Test
 	public void testCheckoutMixedNewlines() throws Exception {
 		// "git config core.autocrlf true"
 		StoredConfig config = git.getRepository().getConfig();
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DfsGarbageCollectorTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DfsGarbageCollectorTest.java
new file mode 100644
index 0000000..c7125bb
--- /dev/null
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DfsGarbageCollectorTest.java
@@ -0,0 +1,239 @@
+package org.eclipse.jgit.internal.storage.dfs;
+
+import static org.eclipse.jgit.internal.storage.dfs.DfsObjDatabase.PackSource.GC;
+import static org.eclipse.jgit.internal.storage.dfs.DfsObjDatabase.PackSource.INSERT;
+import static org.eclipse.jgit.internal.storage.dfs.DfsObjDatabase.PackSource.UNREACHABLE_GARBAGE;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.IOException;
+import java.util.concurrent.TimeUnit;
+
+import org.eclipse.jgit.internal.storage.dfs.DfsObjDatabase.PackSource;
+import org.eclipse.jgit.junit.TestRepository;
+import org.eclipse.jgit.lib.AnyObjectId;
+import org.eclipse.jgit.lib.Ref;
+import org.eclipse.jgit.lib.Repository;
+import org.eclipse.jgit.revwalk.RevCommit;
+import org.eclipse.jgit.revwalk.RevWalk;
+import org.junit.Before;
+import org.junit.Test;
+
+public class DfsGarbageCollectorTest {
+	private TestRepository<InMemoryRepository> git;
+	private InMemoryRepository repo;
+	private DfsObjDatabase odb;
+
+	@Before
+	public void setUp() throws IOException {
+		DfsRepositoryDescription desc = new DfsRepositoryDescription("test");
+		git = new TestRepository<>(new InMemoryRepository(desc));
+		repo = git.getRepository();
+		odb = repo.getObjectDatabase();
+	}
+
+	@Test
+	public void testCollectionWithNoGarbage() throws Exception {
+		RevCommit commit0 = commit().message("0").create();
+		RevCommit commit1 = commit().message("1").parent(commit0).create();
+		git.update("master", commit1);
+
+		assertTrue("commit0 reachable", isReachable(repo, commit0));
+		assertTrue("commit1 reachable", isReachable(repo, commit1));
+
+		// Packs start out as INSERT.
+		assertEquals(2, odb.getPacks().length);
+		for (DfsPackFile pack : odb.getPacks()) {
+			assertEquals(INSERT, pack.getPackDescription().getPackSource());
+		}
+
+		gcNoTtl();
+
+		// Single GC pack present with all objects.
+		assertEquals(1, odb.getPacks().length);
+		DfsPackFile pack = odb.getPacks()[0];
+		assertEquals(GC, pack.getPackDescription().getPackSource());
+		assertTrue("commit0 in pack", isObjectInPack(commit0, pack));
+		assertTrue("commit1 in pack", isObjectInPack(commit1, pack));
+	}
+
+	@Test
+	public void testCollectionWithGarbage() throws Exception {
+		RevCommit commit0 = commit().message("0").create();
+		RevCommit commit1 = commit().message("1").parent(commit0).create();
+		git.update("master", commit0);
+
+		assertTrue("commit0 reachable", isReachable(repo, commit0));
+		assertFalse("commit1 garbage", isReachable(repo, commit1));
+		gcNoTtl();
+
+		assertEquals(2, odb.getPacks().length);
+		DfsPackFile gc = null;
+		DfsPackFile garbage = null;
+		for (DfsPackFile pack : odb.getPacks()) {
+			DfsPackDescription d = pack.getPackDescription();
+			if (d.getPackSource() == GC) {
+				gc = pack;
+			} else if (d.getPackSource() == UNREACHABLE_GARBAGE) {
+				garbage = pack;
+			} else {
+				fail("unexpected " + d.getPackSource());
+			}
+		}
+
+		assertNotNull("created GC pack", gc);
+		assertTrue(isObjectInPack(commit0, gc));
+
+		assertNotNull("created UNREACHABLE_GARBAGE pack", garbage);
+		assertTrue(isObjectInPack(commit1, garbage));
+	}
+
+	@Test
+	public void testCollectionWithGarbageAndGarbagePacksPurged()
+			throws Exception {
+		RevCommit commit0 = commit().message("0").create();
+		RevCommit commit1 = commit().message("1").parent(commit0).create();
+		git.update("master", commit0);
+
+		gcNoTtl();
+		gcWithTtl();
+
+		// The repository has an UNREACHABLE_GARBAGE pack that could have
+		// expired, but since we never purge the most recent UNREACHABLE_GARBAGE
+		// pack, it must have survived the GC.
+		boolean commit1Found = false;
+		for (DfsPackFile pack : odb.getPacks()) {
+			DfsPackDescription d = pack.getPackDescription();
+			if (d.getPackSource() == GC) {
+				assertTrue("has commit0", isObjectInPack(commit0, pack));
+				assertFalse("no commit1", isObjectInPack(commit1, pack));
+			} else if (d.getPackSource() == UNREACHABLE_GARBAGE) {
+				commit1Found |= isObjectInPack(commit1, pack);
+			} else {
+				fail("unexpected " + d.getPackSource());
+			}
+		}
+		assertTrue("garbage commit1 still readable", commit1Found);
+
+		// Find oldest UNREACHABLE_GARBAGE; it will be pruned by next GC.
+		DfsPackDescription oldestGarbagePack = null;
+		for (DfsPackFile pack : odb.getPacks()) {
+			DfsPackDescription d = pack.getPackDescription();
+			if (d.getPackSource() == UNREACHABLE_GARBAGE) {
+				oldestGarbagePack = oldestPack(oldestGarbagePack, d);
+			}
+		}
+		assertNotNull("has UNREACHABLE_GARBAGE", oldestGarbagePack);
+
+		gcWithTtl();
+		assertTrue("has packs", odb.getPacks().length > 0);
+		for (DfsPackFile pack : odb.getPacks()) {
+			assertNotEquals(oldestGarbagePack, pack.getPackDescription());
+		}
+	}
+
+	@Test
+	public void testCollectionWithGarbageCoalescence() throws Exception {
+		RevCommit commit0 = commit().message("0").create();
+		RevCommit commit1 = commit().message("1").parent(commit0).create();
+		git.update("master", commit0);
+
+		for (int i = 0; i < 3; i++) {
+			commit1 = commit().message("g" + i).parent(commit1).create();
+
+			// Make sure we don't have more than 1 UNREACHABLE_GARBAGE pack
+			// because they're coalesced.
+			gcNoTtl();
+			assertEquals(1, countPacks(UNREACHABLE_GARBAGE));
+		}
+	}
+
+	@Test
+	public void testCollectionWithGarbageNoCoalescence() throws Exception {
+		RevCommit commit0 = commit().message("0").create();
+		RevCommit commit1 = commit().message("1").parent(commit0).create();
+		git.update("master", commit0);
+
+		for (int i = 0; i < 3; i++) {
+			commit1 = commit().message("g" + i).parent(commit1).create();
+
+			DfsGarbageCollector gc = new DfsGarbageCollector(repo);
+			gc.setCoalesceGarbageLimit(0);
+			gc.setGarbageTtl(0, TimeUnit.MILLISECONDS);
+			run(gc);
+			assertEquals(1 + i, countPacks(UNREACHABLE_GARBAGE));
+		}
+	}
+
+	private TestRepository<InMemoryRepository>.CommitBuilder commit() {
+		return git.commit();
+	}
+
+	private void gcNoTtl() throws IOException {
+		DfsGarbageCollector gc = new DfsGarbageCollector(repo);
+		gc.setGarbageTtl(0, TimeUnit.MILLISECONDS); // disable TTL
+		run(gc);
+	}
+
+	private void gcWithTtl() throws InterruptedException, IOException {
+		// Wait for the system clock to move by at least 1 millisecond.
+		// This allows the DfsGarbageCollector to recognize the boundary.
+		long start = System.currentTimeMillis();
+		do {
+			Thread.sleep(10);
+		} while (System.currentTimeMillis() <= start);
+
+		DfsGarbageCollector gc = new DfsGarbageCollector(repo);
+		gc.setGarbageTtl(1, TimeUnit.MILLISECONDS);
+		run(gc);
+	}
+
+	private void run(DfsGarbageCollector gc) throws IOException {
+		assertTrue("gc repacked", gc.pack(null));
+		odb.clearCache();
+	}
+
+	private static boolean isReachable(Repository repo, AnyObjectId id)
+			throws IOException {
+		try (RevWalk rw = new RevWalk(repo)) {
+			for (Ref ref : repo.getAllRefs().values()) {
+				rw.markStart(rw.parseCommit(ref.getObjectId()));
+			}
+			for (RevCommit next; (next = rw.next()) != null;) {
+				if (AnyObjectId.equals(next, id)) {
+					return true;
+				}
+			}
+		}
+		return false;
+	}
+
+	private boolean isObjectInPack(AnyObjectId id, DfsPackFile pack)
+			throws IOException {
+		try (DfsReader reader = new DfsReader(odb)) {
+			return pack.hasObject(reader, id);
+		}
+	}
+
+	private static DfsPackDescription oldestPack(DfsPackDescription a,
+			DfsPackDescription b) {
+		if (a != null && a.getLastModified() < b.getLastModified()) {
+			return a;
+		}
+		return b;
+	}
+
+	private int countPacks(PackSource source) throws IOException {
+		int cnt = 0;
+		for (DfsPackFile pack : odb.getPacks()) {
+			if (pack.getPackDescription().getPackSource() == source) {
+				cnt++;
+			}
+		}
+		return cnt;
+	}
+}
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DfsInserterTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DfsInserterTest.java
index 74790f7..b738f7e 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DfsInserterTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DfsInserterTest.java
@@ -219,6 +219,37 @@ public void testInserterIgnoresUnreachable() throws IOException {
 		assertTrue(pack_sources.contains(PackSource.INSERT));
 	}
 
+	@Test
+	public void testNoCheckExisting() throws IOException {
+		byte[] contents = Constants.encode("foo");
+		ObjectId fooId;
+		try (ObjectInserter ins = db.newObjectInserter()) {
+			fooId = ins.insert(Constants.OBJ_BLOB, contents);
+			ins.flush();
+		}
+		assertEquals(1, db.getObjectDatabase().listPacks().size());
+
+		try (ObjectInserter ins = db.newObjectInserter()) {
+			((DfsInserter) ins).checkExisting(false);
+			assertEquals(fooId, ins.insert(Constants.OBJ_BLOB, contents));
+			ins.flush();
+		}
+		assertEquals(2, db.getObjectDatabase().listPacks().size());
+
+		// Verify that we have a foo in both INSERT packs.
+		DfsReader reader = new DfsReader(db.getObjectDatabase());
+		DfsPackFile packs[] = db.getObjectDatabase().getPacks();
+
+		assertEquals(2, packs.length);
+		DfsPackFile p1 = packs[0];
+		assertEquals(PackSource.INSERT, p1.getPackDescription().getPackSource());
+		assertTrue(p1.hasObject(reader, fooId));
+
+		DfsPackFile p2 = packs[1];
+		assertEquals(PackSource.INSERT, p2.getPackDescription().getPackSource());
+		assertTrue(p2.hasObject(reader, fooId));
+	}
+
 	private static String readString(ObjectLoader loader) throws IOException {
 		return RawParseUtils.decode(readStream(loader));
 	}
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutTest.java
index fbe7dd0..bb553a4 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/DirCacheCheckoutTest.java
@@ -1614,6 +1614,64 @@ public void testFileModeChangeAndContentChangeNoConflict() throws Exception {
 		assertNotNull(git.checkout().setName(Constants.MASTER).call());
 	}
 
+	@Test(expected = CheckoutConflictException.class)
+	public void testFolderFileConflict() throws Exception {
+		RevCommit headCommit = commitFile("f/a", "initial content", "master");
+		RevCommit checkoutCommit = commitFile("f/a", "side content", "side");
+		FileUtils.delete(new File(db.getWorkTree(), "f"), FileUtils.RECURSIVE);
+		writeTrashFile("f", "file instead of folder");
+		new DirCacheCheckout(db, headCommit.getTree(), db.lockDirCache(),
+				checkoutCommit.getTree()).checkout();
+	}
+
+	@Test
+	public void testMultipleContentConflicts() throws Exception {
+		commitFile("a", "initial content", "master");
+		RevCommit headCommit = commitFile("b", "initial content", "master");
+		commitFile("a", "side content", "side");
+		RevCommit checkoutCommit = commitFile("b", "side content", "side");
+		writeTrashFile("a", "changed content");
+		writeTrashFile("b", "changed content");
+
+		try {
+			new DirCacheCheckout(db, headCommit.getTree(), db.lockDirCache(),
+					checkoutCommit.getTree()).checkout();
+			fail();
+		} catch (CheckoutConflictException expected) {
+			assertEquals(2, expected.getConflictingFiles().length);
+			assertTrue(Arrays.asList(expected.getConflictingFiles())
+					.contains("a"));
+			assertTrue(Arrays.asList(expected.getConflictingFiles())
+					.contains("b"));
+			assertEquals("changed content", read("a"));
+			assertEquals("changed content", read("b"));
+		}
+	}
+
+	@Test
+	public void testFolderFileAndContentConflicts() throws Exception {
+		RevCommit headCommit = commitFile("f/a", "initial content", "master");
+		commitFile("b", "side content", "side");
+		RevCommit checkoutCommit = commitFile("f/a", "side content", "side");
+		FileUtils.delete(new File(db.getWorkTree(), "f"), FileUtils.RECURSIVE);
+		writeTrashFile("f", "file instead of a folder");
+		writeTrashFile("b", "changed content");
+
+		try {
+			new DirCacheCheckout(db, headCommit.getTree(), db.lockDirCache(),
+					checkoutCommit.getTree()).checkout();
+			fail();
+		} catch (CheckoutConflictException expected) {
+			assertEquals(2, expected.getConflictingFiles().length);
+			assertTrue(Arrays.asList(expected.getConflictingFiles())
+					.contains("b"));
+			assertTrue(Arrays.asList(expected.getConflictingFiles())
+					.contains("f"));
+			assertEquals("file instead of a folder", read("f"));
+			assertEquals("changed content", read("b"));
+		}
+	}
+
 	public void assertWorkDir(Map<String, String> i)
 			throws CorruptObjectException,
 			IOException {
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/HttpAuthTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/HttpAuthTest.java
index 5233013..3dc022d 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/HttpAuthTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/HttpAuthTest.java
@@ -100,7 +100,7 @@ private static void checkResponse(String[] headers,
 		} catch (IOException e) {
 			fail("Couldn't instantiate AuthHeadersResponse: " + e.toString());
 		}
-		HttpAuthMethod authMethod = HttpAuthMethod.scanResponse(response);
+		HttpAuthMethod authMethod = HttpAuthMethod.scanResponse(response, null);
 
 		if (!expectedAuthMethod.equals(getAuthMethodName(authMethod))) {
 			fail("Wrong authentication method: expected " + expectedAuthMethod
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushConnectionTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushConnectionTest.java
index a3b4134..33a9105 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushConnectionTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushConnectionTest.java
@@ -43,13 +43,18 @@
 
 package org.eclipse.jgit.transport;
 
+import static org.eclipse.jgit.transport.BasePackPushConnection.CAPABILITY_REPORT_STATUS;
+import static org.eclipse.jgit.transport.BasePackPushConnection.CAPABILITY_SIDE_BAND_64K;
 import static org.eclipse.jgit.transport.RemoteRefUpdate.Status.REJECTED_OTHER_REASON;
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
 
 import java.io.IOException;
+import java.io.StringWriter;
 import java.util.HashMap;
 import java.util.Map;
 
+import org.eclipse.jgit.errors.TransportException;
 import org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription;
 import org.eclipse.jgit.internal.storage.dfs.InMemoryRepository;
 import org.eclipse.jgit.lib.Constants;
@@ -125,19 +130,47 @@ public void testWrongOldIdDoesNotReplace() throws IOException {
 		Map<String, RemoteRefUpdate> updates = new HashMap<>();
 		updates.put(rru.getRemoteName(), rru);
 
-		Transport tn = testProtocol.open(uri, client, "server");
-		try {
-			PushConnection connection = tn.openPush();
-			try {
-				connection.push(NullProgressMonitor.INSTANCE, updates);
-			} finally {
-				connection.close();
-			}
-		} finally {
-			tn.close();
+		try (Transport tn = testProtocol.open(uri, client, "server");
+				PushConnection connection = tn.openPush()) {
+			connection.push(NullProgressMonitor.INSTANCE, updates);
 		}
 
 		assertEquals(REJECTED_OTHER_REASON, rru.getStatus());
 		assertEquals("invalid old id sent", rru.getMessage());
 	}
+
+	@Test
+	public void invalidCommand() throws IOException {
+		try (Transport tn = testProtocol.open(uri, client, "server");
+				InternalPushConnection c = (InternalPushConnection) tn.openPush()) {
+			StringWriter msgs = new StringWriter();
+			PacketLineOut pckOut = c.pckOut;
+
+			@SuppressWarnings("resource")
+			SideBandInputStream in = new SideBandInputStream(c.in,
+					NullProgressMonitor.INSTANCE, msgs, null);
+
+			// Explicitly invalid command, but sane enough capabilities.
+			StringBuilder buf = new StringBuilder();
+			buf.append("42");
+			buf.append(' ');
+			buf.append(obj2.name());
+			buf.append(' ');
+			buf.append("refs/heads/A" + obj2.name());
+			buf.append('\0').append(CAPABILITY_SIDE_BAND_64K);
+			buf.append(' ').append(CAPABILITY_REPORT_STATUS);
+			buf.append('\n');
+			pckOut.writeString(buf.toString());
+			pckOut.end();
+
+			try {
+				in.read();
+				fail("expected TransportException");
+			} catch (TransportException e) {
+				assertEquals(
+						"remote: error: invalid protocol: wanted 'old new ref'",
+						e.getMessage());
+			}
+		}
+	}
 }
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/RefAdvertiserTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/RefAdvertiserTest.java
new file mode 100644
index 0000000..ce69adf
--- /dev/null
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/RefAdvertiserTest.java
@@ -0,0 +1,116 @@
+/*
+ * 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 static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertSame;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+
+import org.eclipse.jgit.lib.Constants;
+import org.eclipse.jgit.lib.ObjectId;
+import org.eclipse.jgit.lib.ObjectInserter;
+import org.eclipse.jgit.transport.RefAdvertiser.PacketLineOutRefAdvertiser;
+import org.eclipse.jgit.util.NB;
+import org.junit.Test;
+
+public class RefAdvertiserTest {
+	@Test
+	public void advertiser() throws IOException {
+		ByteArrayOutputStream buf = new ByteArrayOutputStream();
+		PacketLineOut pckOut = new PacketLineOut(buf);
+		PacketLineOutRefAdvertiser adv = new PacketLineOutRefAdvertiser(pckOut);
+
+		// Advertisement of capability and id both happen in order of call,
+		// which may not match Git standards. Callers are responsible for
+		// making calls in the correct ordering. Here in this test we do them
+		// in a "wrong" order to assert the method just writes to the network.
+
+		adv.advertiseCapability("test-1");
+		adv.advertiseCapability("sideband");
+		adv.advertiseId(id(1), "refs/heads/master");
+		adv.advertiseId(id(4), "refs/" + padStart("F", 987));
+		adv.advertiseId(id(2), "refs/heads/next");
+		adv.advertiseId(id(3), "refs/Iñtërnâtiônàlizætiøn☃💩");
+		adv.end();
+		assertFalse(adv.isEmpty());
+
+		PacketLineIn pckIn = new PacketLineIn(
+				new ByteArrayInputStream(buf.toByteArray()));
+		String s = pckIn.readStringRaw();
+		assertEquals(id(1).name() + " refs/heads/master\0 test-1 sideband\n",
+				s);
+
+		s = pckIn.readStringRaw();
+		assertEquals(id(4).name() + " refs/" + padStart("F", 987) + '\n', s);
+
+		s = pckIn.readStringRaw();
+		assertEquals(id(2).name() + " refs/heads/next\n", s);
+
+		s = pckIn.readStringRaw();
+		assertEquals(id(3).name() + " refs/Iñtërnâtiônàlizætiøn☃💩\n", s);
+
+		s = pckIn.readStringRaw();
+		assertSame(PacketLineIn.END, s);
+	}
+
+	private static ObjectId id(int i) {
+		try (ObjectInserter.Formatter f = new ObjectInserter.Formatter()) {
+			byte[] tmp = new byte[4];
+			NB.encodeInt32(tmp, 0, i);
+			return f.idFor(Constants.OBJ_BLOB, tmp);
+		}
+	}
+
+	private static String padStart(String s, int len) {
+		StringBuilder b = new StringBuilder(len);
+		for (int i = s.length(); i < len; i++) {
+			b.append((char) ('a' + (i % 26)));
+		}
+		return b.append(s).toString();
+	}
+}
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/FileTreeIteratorTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/FileTreeIteratorTest.java
index bf1d0e6d..efb5ddb 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/FileTreeIteratorTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/FileTreeIteratorTest.java
@@ -286,7 +286,7 @@ public void testDirCacheMatchingId() throws Exception {
 
 	@Test
 	public void testTreewalkEnterSubtree() throws Exception {
-		try (Git git = new Git(db)) {
+		try (Git git = new Git(db); TreeWalk tw = new TreeWalk(db)) {
 			writeTrashFile("b/c", "b/c");
 			writeTrashFile("z/.git", "gitdir: /tmp/somewhere");
 			git.add().addFilepattern(".").call();
@@ -297,7 +297,6 @@ public void testTreewalkEnterSubtree() throws Exception {
 			FileUtils.delete(new File(db.getWorkTree(), "b"),
 					FileUtils.RECURSIVE);
 
-			TreeWalk tw = new TreeWalk(db);
 			tw.addTree(new DirCacheIterator(db.readDirCache()));
 			tw.addTree(new FileTreeIterator(db));
 			assertTrue(tw.next());
@@ -617,39 +616,41 @@ private Repository createNestedRepo() throws IOException {
 	public void testCustomFileModeStrategy() throws Exception {
 		Repository nestedRepo = createNestedRepo();
 
-		Git git = new Git(nestedRepo);
-		// validate that our custom strategy is honored
-		WorkingTreeIterator customIterator =
-				new FileTreeIterator(nestedRepo, NO_GITLINKS_STRATEGY);
-		git.add().setWorkingTreeIterator(customIterator)
-				.addFilepattern(".").call();
-		assertEquals(
-				"[sub/a.txt, mode:100644, content:content]" +
-				"[sub/nested/b.txt, mode:100644, content:content b]",
-				indexState(nestedRepo, CONTENT));
-
+		try (Git git = new Git(nestedRepo)) {
+			// validate that our custom strategy is honored
+			WorkingTreeIterator customIterator = new FileTreeIterator(
+					nestedRepo, NO_GITLINKS_STRATEGY);
+			git.add().setWorkingTreeIterator(customIterator).addFilepattern(".")
+					.call();
+			assertEquals(
+					"[sub/a.txt, mode:100644, content:content]"
+							+ "[sub/nested/b.txt, mode:100644, content:content b]",
+					indexState(nestedRepo, CONTENT));
+		}
 	}
 
 	@Test
 	public void testCustomFileModeStrategyFromParentIterator() throws Exception {
 		Repository nestedRepo = createNestedRepo();
 
-		Git git = new Git(nestedRepo);
+		try (Git git = new Git(nestedRepo)) {
+			FileTreeIterator customIterator = new FileTreeIterator(nestedRepo,
+					NO_GITLINKS_STRATEGY);
+			File r = new File(nestedRepo.getWorkTree(), "sub");
 
-		FileTreeIterator customIterator =
-				new FileTreeIterator(nestedRepo, NO_GITLINKS_STRATEGY);
-		File r = new File(nestedRepo.getWorkTree(), "sub");
-
-		// here we want to validate that if we create a new iterator using the
-		// constructor that accepts a parent iterator, that the child iterator
-		// correctly inherits the FileModeStrategy from the parent iterator.
-		FileTreeIterator childIterator =
-				new FileTreeIterator(customIterator, r, nestedRepo.getFS());
-		git.add().setWorkingTreeIterator(childIterator).addFilepattern(".").call();
-		assertEquals(
-				"[sub/a.txt, mode:100644, content:content]" +
-				"[sub/nested/b.txt, mode:100644, content:content b]",
-				indexState(nestedRepo, CONTENT));
+			// here we want to validate that if we create a new iterator using
+			// the constructor that accepts a parent iterator, that the child
+			// iterator correctly inherits the FileModeStrategy from the parent
+			// iterator.
+			FileTreeIterator childIterator = new FileTreeIterator(
+					customIterator, r, nestedRepo.getFS());
+			git.add().setWorkingTreeIterator(childIterator).addFilepattern(".")
+					.call();
+			assertEquals(
+					"[sub/a.txt, mode:100644, content:content]"
+							+ "[sub/nested/b.txt, mode:100644, content:content b]",
+					indexState(nestedRepo, CONTENT));
+		}
 	}
 
 
diff --git a/org.eclipse.jgit.ui/META-INF/MANIFEST.MF b/org.eclipse.jgit.ui/META-INF/MANIFEST.MF
index 65627da..5a07886 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.4.1.qualifier
+Bundle-Version: 4.5.0.qualifier
 Bundle-Vendor: %provider_name
 Bundle-RequiredExecutionEnvironment: JavaSE-1.7
-Export-Package: org.eclipse.jgit.awtui;version="4.4.1"
-Import-Package: org.eclipse.jgit.errors;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.lib;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.nls;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.revplot;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.revwalk;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.transport;version="[4.4.1,4.5.0)",
- org.eclipse.jgit.util;version="[4.4.1,4.5.0)"
+Export-Package: org.eclipse.jgit.awtui;version="4.5.0"
+Import-Package: org.eclipse.jgit.errors;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.lib;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.nls;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.revplot;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.revwalk;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.transport;version="[4.5.0,4.6.0)",
+ org.eclipse.jgit.util;version="[4.5.0,4.6.0)"
diff --git a/org.eclipse.jgit.ui/pom.xml b/org.eclipse.jgit.ui/pom.xml
index 6db7bb4..3aa4c88 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.4.1-SNAPSHOT</version>
+    <version>4.5.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>org.eclipse.jgit.ui</artifactId>
diff --git a/org.eclipse.jgit/.settings/.api_filters b/org.eclipse.jgit/.settings/.api_filters
deleted file mode 100644
index bacfb33..0000000
--- a/org.eclipse.jgit/.settings/.api_filters
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<component id="org.eclipse.jgit" version="2">
-    <resource path="META-INF/MANIFEST.MF">
-        <filter id="924844039">
-            <message_arguments>
-                <message_argument value="4.4.1"/>
-                <message_argument value="4.4.0"/>
-            </message_arguments>
-        </filter>
-    </resource>
-    <resource path="src/org/eclipse/jgit/attributes/AttributesNode.java" type="org.eclipse.jgit.attributes.AttributesNode">
-        <filter comment="moved to new AttributesManager" id="338792546">
-            <message_arguments>
-                <message_argument value="org.eclipse.jgit.attributes.AttributesNode"/>
-                <message_argument value="getAttributes(String, boolean, Attributes)"/>
-            </message_arguments>
-        </filter>
-    </resource>
-    <resource path="src/org/eclipse/jgit/attributes/AttributesRule.java" type="org.eclipse.jgit.attributes.AttributesRule">
-        <filter comment="used only in tests: bean naming" id="338792546">
-            <message_arguments>
-                <message_argument value="org.eclipse.jgit.attributes.AttributesRule"/>
-                <message_argument value="dirOnly()"/>
-            </message_arguments>
-        </filter>
-    </resource>
-    <resource path="src/org/eclipse/jgit/dircache/DirCacheCheckout.java" type="org.eclipse.jgit.dircache.DirCacheCheckout">
-        <filter comment="add eol stream type conversion" id="338792546">
-            <message_arguments>
-                <message_argument value="org.eclipse.jgit.dircache.DirCacheCheckout"/>
-                <message_argument value="checkoutEntry(Repository, DirCacheEntry, ObjectReader, boolean)"/>
-            </message_arguments>
-        </filter>
-        <filter comment="add eol stream type conversion" id="338792546">
-            <message_arguments>
-                <message_argument value="org.eclipse.jgit.dircache.DirCacheCheckout"/>
-                <message_argument value="checkoutEntry(Repository, DirCacheEntry, ObjectReader, boolean, String)"/>
-            </message_arguments>
-        </filter>
-        <filter comment="add eol stream type conversion" id="1141899266">
-            <message_arguments>
-                <message_argument value="4.2"/>
-                <message_argument value="4.3"/>
-                <message_argument value="checkoutEntry(Repository, DirCacheEntry, ObjectReader, boolean, DirCacheCheckout.CheckoutMetadata)"/>
-            </message_arguments>
-        </filter>
-    </resource>
-</component>
diff --git a/org.eclipse.jgit/META-INF/MANIFEST.MF b/org.eclipse.jgit/META-INF/MANIFEST.MF
index 06c672c..2b412a7 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.4.1.qualifier
+Bundle-Version: 4.5.0.qualifier
 Bundle-Localization: plugin
 Bundle-Vendor: %provider_name
 Bundle-ActivationPolicy: lazy
-Export-Package: org.eclipse.jgit.annotations;version="4.4.1",
- org.eclipse.jgit.api;version="4.4.1";
+Export-Package: org.eclipse.jgit.annotations;version="4.5.0",
+ org.eclipse.jgit.api;version="4.5.0";
   uses:="org.eclipse.jgit.revwalk,
    org.eclipse.jgit.treewalk.filter,
    org.eclipse.jgit.diff,
@@ -21,50 +21,50 @@
    org.eclipse.jgit.submodule,
    org.eclipse.jgit.transport,
    org.eclipse.jgit.merge",
- org.eclipse.jgit.api.errors;version="4.4.1";uses:="org.eclipse.jgit.lib,org.eclipse.jgit.errors",
- org.eclipse.jgit.attributes;version="4.4.1",
- org.eclipse.jgit.blame;version="4.4.1";
+ org.eclipse.jgit.api.errors;version="4.5.0";uses:="org.eclipse.jgit.lib,org.eclipse.jgit.errors",
+ org.eclipse.jgit.attributes;version="4.5.0",
+ org.eclipse.jgit.blame;version="4.5.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.4.1";
+ org.eclipse.jgit.diff;version="4.5.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.4.1";
+ org.eclipse.jgit.dircache;version="4.5.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.4.1";
+ org.eclipse.jgit.errors;version="4.5.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.4.1";uses:="org.eclipse.jgit.lib",
- org.eclipse.jgit.fnmatch;version="4.4.1",
- org.eclipse.jgit.gitrepo;version="4.4.1";
+ org.eclipse.jgit.events;version="4.5.0";uses:="org.eclipse.jgit.lib",
+ org.eclipse.jgit.fnmatch;version="4.5.0",
+ org.eclipse.jgit.gitrepo;version="4.5.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.4.1";x-internal:=true,
- org.eclipse.jgit.hooks;version="4.4.1";uses:="org.eclipse.jgit.lib",
- org.eclipse.jgit.ignore;version="4.4.1",
- org.eclipse.jgit.ignore.internal;version="4.4.1";x-friends:="org.eclipse.jgit.test",
- org.eclipse.jgit.internal;version="4.4.1";x-friends:="org.eclipse.jgit.test,org.eclipse.jgit.http.test",
- org.eclipse.jgit.internal.ketch;version="4.4.1";x-friends:="org.eclipse.jgit.junit,org.eclipse.jgit.test,org.eclipse.jgit.pgm",
- org.eclipse.jgit.internal.storage.dfs;version="4.4.1";
+ org.eclipse.jgit.gitrepo.internal;version="4.5.0";x-internal:=true,
+ org.eclipse.jgit.hooks;version="4.5.0";uses:="org.eclipse.jgit.lib",
+ org.eclipse.jgit.ignore;version="4.5.0",
+ org.eclipse.jgit.ignore.internal;version="4.5.0";x-friends:="org.eclipse.jgit.test",
+ org.eclipse.jgit.internal;version="4.5.0";x-friends:="org.eclipse.jgit.test,org.eclipse.jgit.http.test",
+ org.eclipse.jgit.internal.ketch;version="4.5.0";x-friends:="org.eclipse.jgit.junit,org.eclipse.jgit.test,org.eclipse.jgit.pgm",
+ org.eclipse.jgit.internal.storage.dfs;version="4.5.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.4.1";
+ org.eclipse.jgit.internal.storage.file;version="4.5.0";
   x-friends:="org.eclipse.jgit.test,
    org.eclipse.jgit.junit,
    org.eclipse.jgit.junit.http,
@@ -72,9 +72,9 @@
    org.eclipse.jgit.lfs.server,
    org.eclipse.jgit.pgm,
    org.eclipse.jgit.pgm.test",
- org.eclipse.jgit.internal.storage.pack;version="4.4.1";x-friends:="org.eclipse.jgit.junit,org.eclipse.jgit.test,org.eclipse.jgit.pgm",
- org.eclipse.jgit.internal.storage.reftree;version="4.4.1";x-friends:="org.eclipse.jgit.junit,org.eclipse.jgit.test,org.eclipse.jgit.pgm",
- org.eclipse.jgit.lib;version="4.4.1";
+ org.eclipse.jgit.internal.storage.pack;version="4.5.0";x-friends:="org.eclipse.jgit.junit,org.eclipse.jgit.test,org.eclipse.jgit.pgm",
+ org.eclipse.jgit.internal.storage.reftree;version="4.5.0";x-friends:="org.eclipse.jgit.junit,org.eclipse.jgit.test,org.eclipse.jgit.pgm",
+ org.eclipse.jgit.lib;version="4.5.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.4.1";
+ org.eclipse.jgit.merge;version="4.5.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.4.1",
- org.eclipse.jgit.notes;version="4.4.1";
+ org.eclipse.jgit.nls;version="4.5.0",
+ org.eclipse.jgit.notes;version="4.5.0";
   uses:="org.eclipse.jgit.lib,
    org.eclipse.jgit.treewalk,
    org.eclipse.jgit.revwalk,
    org.eclipse.jgit.merge",
- org.eclipse.jgit.patch;version="4.4.1";uses:="org.eclipse.jgit.lib,org.eclipse.jgit.diff",
- org.eclipse.jgit.revplot;version="4.4.1";uses:="org.eclipse.jgit.lib,org.eclipse.jgit.revwalk",
- org.eclipse.jgit.revwalk;version="4.4.1";
+ org.eclipse.jgit.patch;version="4.5.0";uses:="org.eclipse.jgit.lib,org.eclipse.jgit.diff",
+ org.eclipse.jgit.revplot;version="4.5.0";uses:="org.eclipse.jgit.lib,org.eclipse.jgit.revwalk",
+ org.eclipse.jgit.revwalk;version="4.5.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.4.1";uses:="org.eclipse.jgit.revwalk,org.eclipse.jgit.lib,org.eclipse.jgit.util",
- org.eclipse.jgit.storage.file;version="4.4.1";uses:="org.eclipse.jgit.lib,org.eclipse.jgit.util",
- org.eclipse.jgit.storage.pack;version="4.4.1";uses:="org.eclipse.jgit.lib",
- org.eclipse.jgit.submodule;version="4.4.1";uses:="org.eclipse.jgit.lib,org.eclipse.jgit.treewalk.filter,org.eclipse.jgit.treewalk",
- org.eclipse.jgit.transport;version="4.4.1";
+ org.eclipse.jgit.revwalk.filter;version="4.5.0";uses:="org.eclipse.jgit.revwalk,org.eclipse.jgit.lib,org.eclipse.jgit.util",
+ org.eclipse.jgit.storage.file;version="4.5.0";uses:="org.eclipse.jgit.lib,org.eclipse.jgit.util",
+ org.eclipse.jgit.storage.pack;version="4.5.0";uses:="org.eclipse.jgit.lib",
+ org.eclipse.jgit.submodule;version="4.5.0";uses:="org.eclipse.jgit.lib,org.eclipse.jgit.treewalk.filter,org.eclipse.jgit.treewalk",
+ org.eclipse.jgit.transport;version="4.5.0";
   uses:="org.eclipse.jgit.transport.resolver,
    org.eclipse.jgit.revwalk,
    org.eclipse.jgit.internal.storage.pack,
@@ -121,22 +121,22 @@
    org.eclipse.jgit.transport.http,
    org.eclipse.jgit.errors,
    org.eclipse.jgit.storage.pack",
- org.eclipse.jgit.transport.http;version="4.4.1";uses:="javax.net.ssl",
- org.eclipse.jgit.transport.resolver;version="4.4.1";uses:="org.eclipse.jgit.lib,org.eclipse.jgit.transport",
- org.eclipse.jgit.treewalk;version="4.4.1";
+ org.eclipse.jgit.transport.http;version="4.5.0";uses:="javax.net.ssl",
+ org.eclipse.jgit.transport.resolver;version="4.5.0";uses:="org.eclipse.jgit.lib,org.eclipse.jgit.transport",
+ org.eclipse.jgit.treewalk;version="4.5.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.4.1";uses:="org.eclipse.jgit.treewalk",
- org.eclipse.jgit.util;version="4.4.1";
+ org.eclipse.jgit.treewalk.filter;version="4.5.0";uses:="org.eclipse.jgit.treewalk",
+ org.eclipse.jgit.util;version="4.5.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.4.1"
+ org.eclipse.jgit.util.io;version="4.5.0"
 Bundle-RequiredExecutionEnvironment: JavaSE-1.7
 Require-Bundle: com.jcraft.jsch;bundle-version="[0.1.37,0.2.0)"
 Import-Package: com.googlecode.javaewah;version="[0.7.9,0.8.0)",
diff --git a/org.eclipse.jgit/META-INF/SOURCE-MANIFEST.MF b/org.eclipse.jgit/META-INF/SOURCE-MANIFEST.MF
index 1543b18..d0b7859 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.4.1.qualifier
-Eclipse-SourceBundle: org.eclipse.jgit;version="4.4.1.qualifier";roots="."
+Bundle-Version: 4.5.0.qualifier
+Eclipse-SourceBundle: org.eclipse.jgit;version="4.5.0.qualifier";roots="."
diff --git a/org.eclipse.jgit/pom.xml b/org.eclipse.jgit/pom.xml
index 66e570f..1f8907e 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.4.1-SNAPSHOT</version>
+    <version>4.5.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 21fbaa4..e68bca0 100644
--- a/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties
+++ b/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties
@@ -591,7 +591,7 @@
 submodulesNotSupported=Submodules are not supported
 supportOnlyPackIndexVersion2=Only support index version 2
 symlinkCannotBeWrittenAsTheLinkTarget=Symlink "{0}" cannot be written as the link target cannot be read from within Java.
-systemConfigFileInvalid=Systen wide config file {0} is invalid {1}
+systemConfigFileInvalid=System wide config file {0} is invalid {1}
 tagAlreadyExists=tag ''{0}'' already exists
 tagNameInvalid=tag name {0} is invalid
 tagOnRepoWithoutHEADCurrentlyNotSupported=Tag on repository without HEAD currently not supported
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 12ceb74..ab61c59 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java
@@ -718,10 +718,23 @@ void processEntry(CanonicalTreeParser h, CanonicalTreeParser m,
 			return;
 		}
 
-		// if we have no file at all then there is nothing to do
-		if ((ffMask & 0x222) == 0
-				&& (f == null || FileMode.TREE.equals(f.getEntryFileMode())))
-			return;
+		if ((ffMask & 0x222) == 0) {
+			// HEAD, MERGE and index don't contain a file (e.g. all contain a
+			// folder)
+			if (f == null || FileMode.TREE.equals(f.getEntryFileMode())) {
+				// the workingtree entry doesn't exist or also contains a folder
+				// -> no problem
+				return;
+			} else {
+				// the workingtree entry exists and is not a folder
+				if (!idEqual(h, m)) {
+					// Because HEAD and MERGE differ we will try to update the
+					// workingtree with a folder -> return a conflict
+					conflict(name, null, null, null);
+				}
+				return;
+			}
+		}
 
 		if ((ffMask == 0x00F) && f != null && FileMode.TREE.equals(f.getEntryFileMode())) {
 			// File/Directory conflict case #20
@@ -1004,6 +1017,17 @@ && isModified_IndexTree(name, iId, iMode, mId, mMode,
 		}
 	}
 
+	private static boolean idEqual(AbstractTreeIterator a,
+			AbstractTreeIterator b) {
+		if (a == b) {
+			return true;
+		}
+		if (a == null || b == null) {
+			return false;
+		}
+		return a.getEntryObjectId().equals(b.getEntryObjectId());
+	}
+
 	/**
 	 * A conflict is detected - add the three different stages to the index
 	 * @param path the path of the conflicting entry
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsBlock.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsBlock.java
index 7926536..4a33fb8 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsBlock.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsBlock.java
@@ -88,9 +88,16 @@ int copy(int p, byte[] b, int o, int n) {
 		return n;
 	}
 
-	int setInput(long pos, Inflater inf) {
+	int setInput(long pos, Inflater inf) throws DataFormatException {
 		int ptr = (int) (pos - start);
 		int cnt = block.length - ptr;
+		if (cnt <= 0) {
+			throw new DataFormatException(cnt + " bytes to inflate:" //$NON-NLS-1$
+					+ " at pos=" + pos //$NON-NLS-1$
+					+ "; block.start=" + start //$NON-NLS-1$
+					+ "; ptr=" + ptr //$NON-NLS-1$
+					+ "; block.length=" + block.length); //$NON-NLS-1$
+		}
 		inf.setInput(block, ptr, cnt);
 		return cnt;
 	}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsGarbageCollector.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsGarbageCollector.java
index dc91a70..6f760ca 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsGarbageCollector.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsGarbageCollector.java
@@ -44,6 +44,7 @@
 package org.eclipse.jgit.internal.storage.dfs;
 
 import static org.eclipse.jgit.internal.storage.dfs.DfsObjDatabase.PackSource.GC;
+import static org.eclipse.jgit.internal.storage.dfs.DfsObjDatabase.PackSource.GC_REST;
 import static org.eclipse.jgit.internal.storage.dfs.DfsObjDatabase.PackSource.GC_TXN;
 import static org.eclipse.jgit.internal.storage.dfs.DfsObjDatabase.PackSource.UNREACHABLE_GARBAGE;
 import static org.eclipse.jgit.internal.storage.pack.PackExt.BITMAP_INDEX;
@@ -53,9 +54,11 @@
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
+import java.util.concurrent.TimeUnit;
 
 import org.eclipse.jgit.internal.JGitText;
 import org.eclipse.jgit.internal.storage.dfs.DfsObjDatabase.PackSource;
@@ -92,9 +95,13 @@ public class DfsGarbageCollector {
 
 	private PackConfig packConfig;
 
+	// See pack(), below, for how these two variables interact.
 	private long coalesceGarbageLimit = 50 << 20;
+	private long garbageTtlMillis = TimeUnit.DAYS.toMillis(1);
 
+	private long startTimeMillis;
 	private List<DfsPackFile> packsBefore;
+	private List<DfsPackFile> expiredGarbagePacks;
 
 	private Set<ObjectId> allHeads;
 	private Set<ObjectId> nonHeads;
@@ -167,6 +174,34 @@ public DfsGarbageCollector setCoalesceGarbageLimit(long limit) {
 	}
 
 	/**
+	 * @return garbage packs older than this limit (in milliseconds) will be
+	 *         pruned as part of the garbage collection process if the value is
+	 *         > 0, otherwise garbage packs are retained.
+	 */
+	public long getGarbageTtlMillis() {
+		return garbageTtlMillis;
+	}
+
+	/**
+	 * Set the time to live for garbage objects.
+	 * <p>
+	 * Any UNREACHABLE_GARBAGE older than this limit will be pruned at the end
+	 * of the run.
+	 * <p>
+	 * If timeToLiveMillis is set to 0, UNREACHABLE_GARBAGE purging is disabled.
+	 *
+	 * @param ttl
+	 *            Time to live whatever unit is specified.
+	 * @param unit
+	 *            The specified time unit.
+	 * @return {@code this}
+	 */
+	public DfsGarbageCollector setGarbageTtl(long ttl, TimeUnit unit) {
+		garbageTtlMillis = unit.toMillis(ttl);
+		return this;
+	}
+
+	/**
 	 * Create a single new pack file containing all of the live objects.
 	 * <p>
 	 * This method safely decides which packs can be expired after the new pack
@@ -188,16 +223,28 @@ public boolean pack(ProgressMonitor pm) throws IOException {
 		if (packConfig.getIndexVersion() != 2)
 			throw new IllegalStateException(
 					JGitText.get().supportOnlyPackIndexVersion2);
+		if (garbageTtlMillis > 0) {
+			// We disable coalescing because the coalescing step will keep
+			// refreshing the UNREACHABLE_GARBAGE pack and we wouldn't
+			// actually prune anything.
+			coalesceGarbageLimit = 0;
+		}
 
+		startTimeMillis = System.currentTimeMillis();
 		ctx = (DfsReader) objdb.newReader();
 		try {
 			refdb.refresh();
 			objdb.clearCache();
 
 			Collection<Ref> refsBefore = getAllRefs();
-			packsBefore = packsToRebuild();
-			if (packsBefore.isEmpty())
+			readPacksBefore();
+
+			if (packsBefore.isEmpty()) {
+				if (!expiredGarbagePacks.isEmpty()) {
+					objdb.commitPack(noPacks(), toPrune());
+				}
 				return true;
+			}
 
 			allHeads = new HashSet<ObjectId>();
 			nonHeads = new HashSet<ObjectId>();
@@ -252,17 +299,60 @@ private Collection<Ref> getAllRefs() throws IOException {
 		return refs;
 	}
 
-	private List<DfsPackFile> packsToRebuild() throws IOException {
+	private void readPacksBefore() throws IOException {
 		DfsPackFile[] packs = objdb.getPacks();
-		List<DfsPackFile> out = new ArrayList<DfsPackFile>(packs.length);
+		packsBefore = new ArrayList<DfsPackFile>(packs.length);
+		expiredGarbagePacks = new ArrayList<DfsPackFile>(packs.length);
+
+		long mostRecentGC = mostRecentGC(packs);
+		long now = System.currentTimeMillis();
 		for (DfsPackFile p : packs) {
 			DfsPackDescription d = p.getPackDescription();
-			if (d.getPackSource() != UNREACHABLE_GARBAGE)
-				out.add(p);
-			else if (d.getFileSize(PackExt.PACK) < coalesceGarbageLimit)
-				out.add(p);
+			if (d.getPackSource() != UNREACHABLE_GARBAGE) {
+				packsBefore.add(p);
+			} else if (packIsExpiredGarbage(d, mostRecentGC, now)) {
+				expiredGarbagePacks.add(p);
+			} else if (d.getFileSize(PackExt.PACK) < coalesceGarbageLimit) {
+				packsBefore.add(p);
+			}
 		}
-		return out;
+	}
+
+	private static long mostRecentGC(DfsPackFile[] packs) {
+		long r = 0;
+		for (DfsPackFile p : packs) {
+			DfsPackDescription d = p.getPackDescription();
+			if (d.getPackSource() == GC || d.getPackSource() == GC_REST) {
+				r = Math.max(r, d.getLastModified());
+			}
+		}
+		return r;
+	}
+
+	private boolean packIsExpiredGarbage(DfsPackDescription d,
+			long mostRecentGC, long now) {
+		// It should be safe to remove an UNREACHABLE_GARBAGE pack if it:
+		//
+		// (a) Predates the most recent prior run of this class. This check
+		// ensures the graph traversal algorithm had a chance to consider
+		// all objects in this pack and copied them into a GC or GC_REST
+		// pack if the graph contained live edges to the objects.
+		//
+		// This check is safe because of the ordering of packing; the GC
+		// packs are written first and then the UNREACHABLE_GARBAGE is
+		// constructed. Any UNREACHABLE_GARBAGE dated earlier than the GC
+		// was input to the prior GC's graph traversal.
+		//
+		// (b) Is older than garbagePackTtl. This check gives concurrent
+		// inserter threads sufficient time to identify an object is not
+		// in the graph and should have a new copy written, rather than
+		// relying on something from an UNREACHABLE_GARBAGE pack.
+		//
+		// Both (a) and (b) must be met to safely remove UNREACHABLE_GARBAGE.
+		return d.getPackSource() == UNREACHABLE_GARBAGE
+				&& d.getLastModified() < mostRecentGC
+				&& garbageTtlMillis > 0
+				&& now - d.getLastModified() >= garbageTtlMillis;
 	}
 
 	/** @return all of the source packs that fed into this compaction. */
@@ -283,8 +373,12 @@ public List<PackStatistics> getNewPackStatistics() {
 	private List<DfsPackDescription> toPrune() {
 		int cnt = packsBefore.size();
 		List<DfsPackDescription> all = new ArrayList<DfsPackDescription>(cnt);
-		for (DfsPackFile pack : packsBefore)
+		for (DfsPackFile pack : packsBefore) {
 			all.add(pack.getPackDescription());
+		}
+		for (DfsPackFile pack : expiredGarbagePacks) {
+			all.add(pack.getPackDescription());
+		}
 		return all;
 	}
 
@@ -299,6 +393,7 @@ private void packHeads(ProgressMonitor pm) throws IOException {
 				writePack(GC, pw, pm);
 		}
 	}
+
 	private void packRest(ProgressMonitor pm) throws IOException {
 		if (nonHeads.isEmpty())
 			return;
@@ -308,7 +403,7 @@ private void packRest(ProgressMonitor pm) throws IOException {
 				pw.excludeObjects(packedObjs);
 			pw.preparePack(pm, nonHeads, allHeads);
 			if (0 < pw.getObjectCount())
-				writePack(GC, pw, pm);
+				writePack(GC_REST, pw, pm);
 		}
 	}
 
@@ -326,7 +421,6 @@ private void packRefTreeGraph(ProgressMonitor pm) throws IOException {
 	}
 
 	private void packGarbage(ProgressMonitor pm) throws IOException {
-		// TODO(sop) This is ugly. The garbage pack needs to be deleted.
 		PackConfig cfg = new PackConfig(packConfig);
 		cfg.setReuseDeltas(true);
 		cfg.setReuseObjects(true);
@@ -383,47 +477,42 @@ private PackWriter newPackWriter() {
 
 	private DfsPackDescription writePack(PackSource source, PackWriter pw,
 			ProgressMonitor pm) throws IOException {
-		DfsOutputStream out;
 		DfsPackDescription pack = repo.getObjectDatabase().newPack(source);
 		newPackDesc.add(pack);
 
-		out = objdb.writeFile(pack, PACK);
-		try {
+		try (DfsOutputStream out = objdb.writeFile(pack, PACK)) {
 			pw.writePack(pm, pm, out);
 			pack.addFileExt(PACK);
-		} finally {
-			out.close();
 		}
 
-		out = objdb.writeFile(pack, INDEX);
-		try {
-			CountingOutputStream cnt = new CountingOutputStream(out);
+		try (CountingOutputStream cnt =
+				new CountingOutputStream(objdb.writeFile(pack, INDEX))) {
 			pw.writeIndex(cnt);
 			pack.addFileExt(INDEX);
 			pack.setFileSize(INDEX, cnt.getCount());
 			pack.setIndexVersion(pw.getIndexVersion());
-		} finally {
-			out.close();
 		}
 
 		if (pw.prepareBitmapIndex(pm)) {
-			out = objdb.writeFile(pack, BITMAP_INDEX);
-			try {
-				CountingOutputStream cnt = new CountingOutputStream(out);
+			try (CountingOutputStream cnt = new CountingOutputStream(
+					objdb.writeFile(pack, BITMAP_INDEX))) {
 				pw.writeBitmapIndex(cnt);
 				pack.addFileExt(BITMAP_INDEX);
 				pack.setFileSize(BITMAP_INDEX, cnt.getCount());
-			} finally {
-				out.close();
 			}
 		}
 
 		PackStatistics stats = pw.getStatistics();
 		pack.setPackStats(stats);
+		pack.setLastModified(startTimeMillis);
 		newPackStats.add(stats);
 		newPackObj.add(pw.getObjectSet());
 
 		DfsBlockCache.getInstance().getOrCreate(pack, null);
 		return pack;
 	}
+
+	private static List<DfsPackDescription> noPacks() {
+		return Collections.emptyList();
+	}
 }
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsInserter.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsInserter.java
index f5673e8..c57c417 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsInserter.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsInserter.java
@@ -106,6 +106,7 @@ public class DfsInserter extends ObjectInserter {
 	DfsPackDescription packDsc;
 	PackStream packOut;
 	private boolean rollback;
+	private boolean checkExisting = true;
 
 	/**
 	 * Initialize a new inserter.
@@ -117,6 +118,15 @@ protected DfsInserter(DfsObjDatabase db) {
 		this.db = db;
 	}
 
+	/**
+	 * @param check
+	 *            if false, will write out possibly-duplicate objects without
+	 *            first checking whether they exist in the repo; default is true.
+	 */
+	public void checkExisting(boolean check) {
+		checkExisting = check;
+	}
+
 	void setCompressionLevel(int compression) {
 		this.compression = compression;
 	}
@@ -138,7 +148,7 @@ public ObjectId insert(int type, byte[] data, int off, int len)
 		if (objectMap != null && objectMap.contains(id))
 			return id;
 		// Ignore unreachable (garbage) objects here.
-		if (db.has(id, true))
+		if (checkExisting && db.has(id, true))
 			return id;
 
 		long offset = beginObject(type, len);
@@ -474,7 +484,8 @@ else if (n == 0)
 			}
 		}
 
-		private int setInput(long pos, Inflater inf) throws IOException {
+		private int setInput(long pos, Inflater inf)
+				throws IOException, DataFormatException {
 			if (pos < currPos)
 				return getOrLoadBlock(pos).setInput(pos, inf);
 			if (pos < currPos + currPtr) {
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsObjDatabase.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsObjDatabase.java
index 3641560..3f45859 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsObjDatabase.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsObjDatabase.java
@@ -80,24 +80,6 @@ public static enum PackSource {
 		RECEIVE(0),
 
 		/**
-		 * Pack was created by Git garbage collection by this implementation.
-		 * <p>
-		 * This source is only used by the {@link DfsGarbageCollector} when it
-		 * builds a pack file by traversing the object graph and copying all
-		 * reachable objects into a new pack stream.
-		 *
-		 * @see DfsGarbageCollector
-		 */
-		GC(1),
-
-		/**
-		 * RefTreeGraph pack was created by Git garbage collection.
-		 *
-		 * @see DfsGarbageCollector
-		 */
-		GC_TXN(1),
-
-		/**
 		 * The pack was created by compacting multiple packs together.
 		 * <p>
 		 * Packs created by compacting multiple packs together aren't nearly as
@@ -109,13 +91,34 @@ public static enum PackSource {
 		COMPACT(1),
 
 		/**
+		 * Pack was created by Git garbage collection by this implementation.
+		 * <p>
+		 * This source is only used by the {@link DfsGarbageCollector} when it
+		 * builds a pack file by traversing the object graph and copying all
+		 * reachable objects into a new pack stream.
+		 *
+		 * @see DfsGarbageCollector
+		 */
+		GC(2),
+
+		/** Created from non-heads by {@link DfsGarbageCollector}. */
+		GC_REST(3),
+
+		/**
+		 * RefTreeGraph pack was created by Git garbage collection.
+		 *
+		 * @see DfsGarbageCollector
+		 */
+		GC_TXN(4),
+
+		/**
 		 * Pack was created by Git garbage collection.
 		 * <p>
 		 * This pack contains only unreachable garbage that was found during the
 		 * last GC pass. It is retained in a new pack until it is safe to prune
 		 * these objects from the repository.
 		 */
-		UNREACHABLE_GARBAGE(2);
+		UNREACHABLE_GARBAGE(5);
 
 		final int category;
 
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/BatchRefUpdate.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/BatchRefUpdate.java
index 35cadd3..c0e1fcb 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/BatchRefUpdate.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/BatchRefUpdate.java
@@ -487,7 +487,11 @@ public String toString() {
 		for (ReceiveCommand cmd : commands) {
 			r.append("  "); //$NON-NLS-1$
 			r.append(cmd);
-			r.append("  (").append(cmd.getResult()).append(")\n"); //$NON-NLS-1$ //$NON-NLS-2$
+			r.append("  (").append(cmd.getResult()); //$NON-NLS-1$
+			if (cmd.getMessage() != null) {
+				r.append(": ").append(cmd.getMessage()); //$NON-NLS-1$
+			}
+			r.append(")\n"); //$NON-NLS-1$
 		}
 		return r.append(']').toString();
 	}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Config.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Config.java
index 1e1d147..a041bb7 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Config.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Config.java
@@ -510,7 +510,7 @@ public String getString(final String section, String subsection,
 	 *            indication of the units.
 	 * @return the value, or {@code defaultValue} if not set, expressed in
 	 *         {@code units}.
-	 * @since 4.4
+	 * @since 4.5
 	 */
 	public long getTimeUnit(String section, String subsection, String name,
 			long defaultValue, TimeUnit wantUnit) {
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackPushConnection.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackPushConnection.java
index 9b8ba80..0cbbdc7 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackPushConnection.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackPushConnection.java
@@ -47,6 +47,7 @@
 import static org.eclipse.jgit.transport.GitProtocolConstants.CAPABILITY_ATOMIC;
 
 import java.io.IOException;
+import java.io.InputStream;
 import java.io.OutputStream;
 import java.text.MessageFormat;
 import java.util.Collection;
@@ -317,7 +318,12 @@ private void writePack(final Map<String, RemoteRefUpdate> refUpdates,
 			writer.setReuseValidatingObjects(false);
 			writer.setDeltaBaseAsOffset(capableOfsDelta);
 			writer.preparePack(monitor, newObjects, remoteObjects);
-			writer.writePack(monitor, monitor, out);
+
+			OutputStream packOut = out;
+			if (capableSideBand) {
+				packOut = new CheckingSideBandOutputStream(in, out);
+			}
+			writer.writePack(monitor, monitor, packOut);
 
 			packTransferTime = writer.getStatistics().getTimeWriting();
 		}
@@ -397,4 +403,48 @@ private String readStringLongTimeout() throws IOException {
 			timeoutIn.setTimeout(oldTimeout);
 		}
 	}
+
+	private static class CheckingSideBandOutputStream extends OutputStream {
+		private final InputStream in;
+		private final OutputStream out;
+
+		CheckingSideBandOutputStream(InputStream in, OutputStream out) {
+			this.in = in;
+			this.out = out;
+		}
+
+		@Override
+		public void write(int b) throws IOException {
+			write(new byte[] { (byte) b });
+		}
+
+		@Override
+		public void write(byte[] buf, int ptr, int cnt) throws IOException {
+			try {
+				out.write(buf, ptr, cnt);
+			} catch (IOException e) {
+				throw checkError(e);
+			}
+		}
+
+		@Override
+		public void flush() throws IOException {
+			try {
+				out.flush();
+			} catch (IOException e) {
+				throw checkError(e);
+			}
+		}
+
+		private IOException checkError(IOException e1) {
+			try {
+				in.read();
+			} catch (TransportException e2) {
+				return e2;
+			} catch (IOException e2) {
+				return e1;
+			}
+			return e1;
+		}
+	}
 }
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 b5f9e2f..aae4bd9 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseReceivePack.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseReceivePack.java
@@ -51,6 +51,7 @@
 import static org.eclipse.jgit.transport.GitProtocolConstants.CAPABILITY_SIDE_BAND_64K;
 import static org.eclipse.jgit.transport.GitProtocolConstants.OPTION_AGENT;
 import static org.eclipse.jgit.transport.SideBandOutputStream.CH_DATA;
+import static org.eclipse.jgit.transport.SideBandOutputStream.CH_ERROR;
 import static org.eclipse.jgit.transport.SideBandOutputStream.CH_PROGRESS;
 import static org.eclipse.jgit.transport.SideBandOutputStream.MAX_BUF;
 
@@ -67,6 +68,7 @@
 import java.util.Set;
 import java.util.concurrent.TimeUnit;
 
+import org.eclipse.jgit.errors.InvalidObjectIdException;
 import org.eclipse.jgit.errors.MissingObjectException;
 import org.eclipse.jgit.errors.PackProtocolException;
 import org.eclipse.jgit.errors.TooLargePackException;
@@ -214,6 +216,7 @@ public Set<String> getCapabilities() {
 
 	/** Optional message output stream. */
 	protected OutputStream msgOut;
+	private SideBandOutputStream errOut;
 
 	/** Packet line input stream around {@link #rawIn}. */
 	protected PacketLineIn pckIn;
@@ -878,6 +881,19 @@ public void sendError(final String what) {
 		}
 	}
 
+	private void fatalError(String msg) {
+		if (errOut != null) {
+			try {
+				errOut.write(Constants.encode(msg));
+				errOut.flush();
+			} catch (IOException e) {
+				// Ignore write failures
+			}
+		} else {
+			sendError(msg);
+		}
+	}
+
 	/**
 	 * Send a message to the client, if it supports receiving them.
 	 * <p>
@@ -1076,7 +1092,7 @@ public void sendAdvertisedRefs(final RefAdvertiser adv)
 	 */
 	protected void recvCommands() throws IOException {
 		PushCertificateParser certParser = getPushCertificateParser();
-		FirstLine firstLine = null;
+		boolean firstPkt = true;
 		try {
 			for (;;) {
 				String line;
@@ -1092,14 +1108,16 @@ protected void recvCommands() throws IOException {
 				}
 
 				if (line.length() >= 48 && line.startsWith("shallow ")) { //$NON-NLS-1$
-					clientShallowCommits.add(ObjectId.fromString(line.substring(8, 48)));
+					parseShallow(line.substring(8, 48));
 					continue;
 				}
 
-				if (firstLine == null) {
-					firstLine = new FirstLine(line);
+				if (firstPkt) {
+					firstPkt = false;
+					FirstLine firstLine = new FirstLine(line);
 					enabledCapabilities = firstLine.getCapabilities();
 					line = firstLine.getLine();
+					enableCapabilities();
 
 					if (line.equals(GitProtocolConstants.OPTION_PUSH_CERT)) {
 						certParser.receiveHeader(pckIn, !isBiDirectionalPipe());
@@ -1112,13 +1130,7 @@ protected void recvCommands() throws IOException {
 					continue;
 				}
 
-				ReceiveCommand cmd;
-				try {
-					cmd = parseCommand(line);
-				} catch (PackProtocolException e) {
-					sendError(e.getMessage());
-					throw e;
-				}
+				ReceiveCommand cmd = parseCommand(line);
 				if (cmd.getRefName().equals(Constants.HEAD)) {
 					cmd.setResult(Result.REJECTED_CURRENT_BRANCH);
 				} else {
@@ -1131,11 +1143,28 @@ protected void recvCommands() throws IOException {
 			}
 			pushCert = certParser.build();
 		} catch (PackProtocolException e) {
-			sendError(e.getMessage());
+			if (sideBand) {
+				try {
+					pckIn.discardUntilEnd();
+				} catch (IOException e2) {
+					// Ignore read failures attempting to discard.
+				}
+			}
+			fatalError(e.getMessage());
 			throw e;
 		}
 	}
 
+	private void parseShallow(String idStr) throws PackProtocolException {
+		ObjectId id;
+		try {
+			id = ObjectId.fromString(idStr);
+		} catch (InvalidObjectIdException e) {
+			throw new PackProtocolException(e.getMessage(), e);
+		}
+		clientShallowCommits.add(id);
+	}
+
 	static ReceiveCommand parseCommand(String line) throws PackProtocolException {
           if (line == null || line.length() < 83) {
 			throw new PackProtocolException(
@@ -1147,7 +1176,7 @@ static ReceiveCommand parseCommand(String line) throws PackProtocolException {
 		try {
 			oldId = ObjectId.fromString(oldStr);
 			newId = ObjectId.fromString(newStr);
-		} catch (IllegalArgumentException e) {
+		} catch (InvalidObjectIdException e) {
 			throw new PackProtocolException(
 					JGitText.get().errorInvalidProtocolWantedOldNewRef, e);
 		}
@@ -1168,6 +1197,7 @@ protected void enableCapabilities() {
 
 			rawOut = new SideBandOutputStream(CH_DATA, MAX_BUF, out);
 			msgOut = new SideBandOutputStream(CH_PROGRESS, MAX_BUF, out);
+			errOut = new SideBandOutputStream(CH_ERROR, MAX_BUF, out);
 
 			pckOut = new PacketLineOut(rawOut);
 			pckOut.setFlushOnEnd(false);
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/HttpAuthMethod.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/HttpAuthMethod.java
index 998f280..81e6904 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/HttpAuthMethod.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/HttpAuthMethod.java
@@ -51,6 +51,7 @@
 import java.net.URL;
 import java.security.MessageDigest;
 import java.security.NoSuchAlgorithmException;
+import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.LinkedHashMap;
@@ -149,9 +150,12 @@ public String getSchemeName() {
 	 *
 	 * @param conn
 	 *            the connection that failed.
+	 * @param ignoreTypes
+	 *            authentication types to be ignored.
 	 * @return new authentication method to try.
 	 */
-	static HttpAuthMethod scanResponse(final HttpConnection conn) {
+	static HttpAuthMethod scanResponse(final HttpConnection conn,
+			Collection<Type> ignoreTypes) {
 		final Map<String, List<String>> headers = conn.getHeaderFields();
 		HttpAuthMethod authentication = Type.NONE.method(EMPTY_STRING);
 
@@ -165,6 +169,12 @@ static HttpAuthMethod scanResponse(final HttpConnection conn) {
 
 							try {
 								Type methodType = Type.valueOf(valuePart[0].toUpperCase());
+
+								if ((ignoreTypes != null)
+										&& (ignoreTypes.contains(methodType))) {
+									continue;
+								}
+
 								if (authentication.getType().compareTo(methodType) >= 0) {
 									continue;
 								}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/JschConfigSessionFactory.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/JschConfigSessionFactory.java
index 308741e..d1cbd8d 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/JschConfigSessionFactory.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/JschConfigSessionFactory.java
@@ -1,4 +1,5 @@
 /*
+ * Copyright (C) 2016, Mark Ingram <markdingram@gmail.com>
  * Copyright (C) 2009, Constantine Plotnikov <constantine.plotnikov@gmail.com>
  * Copyright (C) 2008-2009, Google Inc.
  * Copyright (C) 2009, Google, Inc.
@@ -220,6 +221,19 @@ protected Session createSession(final OpenSshConfig.Host hc,
 	}
 
 	/**
+	 * Provide additional configuration for the JSch instance. This method could
+	 * be overridden to supply a preferred
+	 * {@link com.jcraft.jsch.IdentityRepository}.
+	 *
+	 * @param jsch
+	 *            jsch instance
+	 * @since 4.5
+	 */
+	protected void configureJSch(JSch jsch) {
+		// No additional configuration required.
+	}
+
+	/**
 	 * Provide additional configuration for the session based on the host
 	 * information. This method could be used to supply {@link UserInfo}.
 	 *
@@ -257,6 +271,7 @@ protected JSch getJSch(final OpenSshConfig.Host hc, FS fs) throws JSchException
 		JSch jsch = byIdentityFile.get(identityKey);
 		if (jsch == null) {
 			jsch = new JSch();
+			configureJSch(jsch);
 			jsch.setHostKeyRepository(defaultJSch.getHostKeyRepository());
 			jsch.addIdentity(identityKey);
 			byIdentityFile.put(identityKey, jsch);
@@ -274,6 +289,7 @@ protected JSch getJSch(final OpenSshConfig.Host hc, FS fs) throws JSchException
 	 */
 	protected JSch createDefaultJSch(FS fs) throws JSchException {
 		final JSch jsch = new JSch();
+		configureJSch(jsch);
 		knownHosts(jsch, fs);
 		identities(jsch, fs);
 		return jsch;
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PacketLineIn.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PacketLineIn.java
index e1769f8..8d291b8 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PacketLineIn.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PacketLineIn.java
@@ -182,6 +182,16 @@ public String readStringRaw() throws IOException {
 		return RawParseUtils.decode(Constants.CHARSET, raw, 0, len);
 	}
 
+	void discardUntilEnd() throws IOException {
+		for (;;) {
+			int n = readLength();
+			if (n == 0) {
+				break;
+			}
+			IO.skipFully(in, n - 4);
+		}
+	}
+
 	int readLength() throws IOException {
 		IO.readFully(in, lineBuffer, 0, 4);
 		try {
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PacketLineOut.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PacketLineOut.java
index bb83dce..2d4e9c7 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PacketLineOut.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PacketLineOut.java
@@ -113,10 +113,28 @@ public void writeString(final String s) throws IOException {
 	 *             the packet could not be written, the stream is corrupted as
 	 *             the packet may have been only partially written.
 	 */
-	public void writePacket(final byte[] packet) throws IOException {
-		formatLength(packet.length + 4);
+	public void writePacket(byte[] packet) throws IOException {
+		writePacket(packet, 0, packet.length);
+	}
+
+	/**
+	 * Write a binary packet to the stream.
+	 *
+	 * @param buf
+	 *            the packet to write
+	 * @param pos
+	 *            first index within {@code buf}.
+	 * @param len
+	 *            number of bytes to write.
+	 * @throws IOException
+	 *             the packet could not be written, the stream is corrupted as
+	 *             the packet may have been only partially written.
+	 * @since 4.5
+	 */
+	public void writePacket(byte[] buf, int pos, int len) throws IOException {
+		formatLength(len + 4);
 		out.write(lenbuffer, 0, 4);
-		out.write(packet);
+		out.write(buf, pos, len);
 	}
 
 	/**
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceivePack.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceivePack.java
index f61e93f..2477806 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceivePack.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceivePack.java
@@ -184,17 +184,11 @@ private void service() throws IOException {
 			return;
 		recvCommands();
 		if (hasCommands()) {
-			enableCapabilities();
-
 			Throwable unpackError = null;
 			if (needPack()) {
 				try {
 					receivePackAndCheckConnectivity();
-				} catch (IOException err) {
-					unpackError = err;
-				} catch (RuntimeException err) {
-					unpackError = err;
-				} catch (Error err) {
+				} catch (IOException | RuntimeException | Error err) {
 					unpackError = err;
 				}
 			}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/RefAdvertiser.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/RefAdvertiser.java
index f72a4b2..0cd720c 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/RefAdvertiser.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/RefAdvertiser.java
@@ -43,9 +43,16 @@
 
 package org.eclipse.jgit.transport;
 
+import static java.nio.charset.StandardCharsets.UTF_8;
+import static org.eclipse.jgit.lib.Constants.OBJECT_ID_STRING_LENGTH;
 import static org.eclipse.jgit.transport.GitProtocolConstants.OPTION_SYMREF;
 
 import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.nio.CharBuffer;
+import java.nio.charset.CharacterCodingException;
+import java.nio.charset.CharsetEncoder;
+import java.nio.charset.CoderResult;
 import java.util.HashSet;
 import java.util.LinkedHashSet;
 import java.util.Map;
@@ -64,8 +71,15 @@
 public abstract class RefAdvertiser {
 	/** Advertiser which frames lines in a {@link PacketLineOut} format. */
 	public static class PacketLineOutRefAdvertiser extends RefAdvertiser {
+		private final CharsetEncoder utf8 = UTF_8.newEncoder();
 		private final PacketLineOut pckOut;
 
+		private byte[] binArr = new byte[256];
+		private ByteBuffer binBuf = ByteBuffer.wrap(binArr);
+
+		private char[] chArr = new char[256];
+		private CharBuffer chBuf = CharBuffer.wrap(chArr);
+
 		/**
 		 * Create a new advertiser for the supplied stream.
 		 *
@@ -77,6 +91,64 @@ public PacketLineOutRefAdvertiser(PacketLineOut out) {
 		}
 
 		@Override
+		public void advertiseId(AnyObjectId id, String refName)
+				throws IOException {
+			id.copyTo(binArr, 0);
+			binArr[OBJECT_ID_STRING_LENGTH] = ' ';
+			binBuf.position(OBJECT_ID_STRING_LENGTH + 1);
+			append(refName);
+			if (first) {
+				first = false;
+				if (!capablities.isEmpty()) {
+					append('\0');
+					for (String cap : capablities) {
+						append(' ');
+						append(cap);
+					}
+				}
+			}
+			append('\n');
+			pckOut.writePacket(binArr, 0, binBuf.position());
+		}
+
+		private void append(String str) throws CharacterCodingException {
+			int n = str.length();
+			if (n > chArr.length) {
+				chArr = new char[n + 256];
+				chBuf = CharBuffer.wrap(chArr);
+			}
+			str.getChars(0, n, chArr, 0);
+			chBuf.position(0).limit(n);
+			utf8.reset();
+			for (;;) {
+				CoderResult cr = utf8.encode(chBuf, binBuf, true);
+				if (cr.isOverflow()) {
+					grow();
+				} else if (cr.isUnderflow()) {
+					break;
+				} else {
+					cr.throwException();
+				}
+			}
+		}
+
+		private void append(int b) {
+			if (!binBuf.hasRemaining()) {
+				grow();
+			}
+			binBuf.put((byte) b);
+		}
+
+		private void grow() {
+			int cnt = binBuf.position();
+			byte[] tmp = new byte[binArr.length << 1];
+			System.arraycopy(binArr, 0, tmp, 0, cnt);
+			binArr = tmp;
+			binBuf = ByteBuffer.wrap(binArr);
+			binBuf.position(cnt);
+		}
+
+		@Override
 		protected void writeOne(final CharSequence line) throws IOException {
 			pckOut.writeString(line.toString());
 		}
@@ -91,7 +163,7 @@ protected void end() throws IOException {
 
 	private final char[] tmpId = new char[Constants.OBJECT_ID_STRING_LENGTH];
 
-	private final Set<String> capablities = new LinkedHashSet<String>();
+	final Set<String> capablities = new LinkedHashSet<String>();
 
 	private final Set<ObjectId> sent = new HashSet<ObjectId>();
 
@@ -99,7 +171,7 @@ protected void end() throws IOException {
 
 	private boolean derefTags;
 
-	private boolean first = true;
+	boolean first = true;
 
 	/**
 	 * Initialize this advertiser with a repository for peeling tags.
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java
index 414e879..1166080 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TransportHttp.java
@@ -73,6 +73,7 @@
 import java.util.Collection;
 import java.util.Collections;
 import java.util.EnumSet;
+import java.util.HashSet;
 import java.util.LinkedHashSet;
 import java.util.Map;
 import java.util.Set;
@@ -95,6 +96,7 @@
 import org.eclipse.jgit.lib.Ref;
 import org.eclipse.jgit.lib.Repository;
 import org.eclipse.jgit.lib.SymbolicRef;
+import org.eclipse.jgit.transport.HttpAuthMethod.Type;
 import org.eclipse.jgit.transport.http.HttpConnection;
 import org.eclipse.jgit.util.HttpSupport;
 import org.eclipse.jgit.util.IO;
@@ -448,9 +450,11 @@ private HttpConnection connect(final String service)
 			throw new NotSupportedException(MessageFormat.format(JGitText.get().invalidURL, uri), e);
 		}
 
-		try {
-			int authAttempts = 1;
-			for (;;) {
+
+		int authAttempts = 1;
+		Collection<Type> ignoreTypes = null;
+		for (;;) {
+			try {
 				final HttpConnection conn = httpOpen(u);
 				if (useSmartHttp) {
 					String exp = "application/x-" + service + "-advertisement"; //$NON-NLS-1$ //$NON-NLS-2$
@@ -467,7 +471,7 @@ private HttpConnection connect(final String service)
 					// explicit authentication would be required
 					if (authMethod.getType() == HttpAuthMethod.Type.NONE
 							&& conn.getHeaderField(HDR_WWW_AUTHENTICATE) != null)
-						authMethod = HttpAuthMethod.scanResponse(conn);
+						authMethod = HttpAuthMethod.scanResponse(conn, ignoreTypes);
 					return conn;
 
 				case HttpConnection.HTTP_NOT_FOUND:
@@ -475,7 +479,7 @@ private HttpConnection connect(final String service)
 							MessageFormat.format(JGitText.get().uriNotFound, u));
 
 				case HttpConnection.HTTP_UNAUTHORIZED:
-					authMethod = HttpAuthMethod.scanResponse(conn);
+					authMethod = HttpAuthMethod.scanResponse(conn, ignoreTypes);
 					if (authMethod.getType() == HttpAuthMethod.Type.NONE)
 						throw new TransportException(uri, MessageFormat.format(
 								JGitText.get().authenticationNotSupported, uri));
@@ -501,13 +505,27 @@ private HttpConnection connect(final String service)
 					String err = status + " " + conn.getResponseMessage(); //$NON-NLS-1$
 					throw new TransportException(uri, err);
 				}
+			} catch (NotSupportedException e) {
+				throw e;
+			} catch (TransportException e) {
+				throw e;
+			} catch (IOException e) {
+				if (authMethod.getType() != HttpAuthMethod.Type.NONE) {
+					if (ignoreTypes == null) {
+						ignoreTypes = new HashSet<Type>();
+					}
+
+					ignoreTypes.add(authMethod.getType());
+
+					// reset auth method & attempts for next authentication type
+					authMethod = HttpAuthMethod.Type.NONE.method(null);
+					authAttempts = 1;
+
+					continue;
+				}
+
+				throw new TransportException(uri, MessageFormat.format(JGitText.get().cannotOpenService, service), e);
 			}
-		} catch (NotSupportedException e) {
-			throw e;
-		} catch (TransportException e) {
-			throw e;
-		} catch (IOException e) {
-			throw new TransportException(uri, MessageFormat.format(JGitText.get().cannotOpenService, service), e);
 		}
 	}
 
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 e49ee87..e1770f2 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java
@@ -682,7 +682,7 @@ public void upload(final InputStream input, final OutputStream output,
 	 * Get the PackWriter's statistics if a pack was sent to the client.
 	 *
 	 * @return statistics about pack output, if a pack was sent. Null if no pack
-	 *         was sent, such as during the negotation phase of a smart HTTP
+	 *         was sent, such as during the negotiation phase of a smart HTTP
 	 *         connection, or if the client was already up-to-date.
 	 * @since 3.0
 	 * @deprecated Use {@link #getStatistics()}.
@@ -697,7 +697,7 @@ public PackWriter.Statistics getPackStatistics() {
 	 * Get the PackWriter's statistics if a pack was sent to the client.
 	 *
 	 * @return statistics about pack output, if a pack was sent. Null if no pack
-	 *         was sent, such as during the negotation phase of a smart HTTP
+	 *         was sent, such as during the negotiation phase of a smart HTTP
 	 *         connection, or if the client was already up-to-date.
 	 * @since 4.1
 	 */
@@ -777,8 +777,14 @@ else if (requestValidator instanceof AnyRequestValidator)
 	private static Set<ObjectId> refIdSet(Collection<Ref> refs) {
 		Set<ObjectId> ids = new HashSet<ObjectId>(refs.size());
 		for (Ref ref : refs) {
-			if (ref.getObjectId() != null)
-				ids.add(ref.getObjectId());
+			ObjectId id = ref.getObjectId();
+			if (id != null) {
+				ids.add(id);
+			}
+			id = ref.getPeeledObjectId();
+			if (id != null) {
+				ids.add(id);
+			}
 		}
 		return ids;
 	}
@@ -1142,7 +1148,6 @@ private ObjectId processHaveLines(List<ObjectId> peerHas, ObjectId last)
 
 		if (multiAck == MultiAck.DETAILED && !didOkToGiveUp && okToGiveUp()) {
 			ObjectId id = peerHas.get(peerHas.size() - 1);
-			sentReady = true;
 			pckOut.writeString("ACK " + id.name() + " ready\n"); //$NON-NLS-1$ //$NON-NLS-2$
 			sentReady = true;
 		}
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 7dac50a..911b7ff 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/TreeWalk.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/TreeWalk.java
@@ -795,7 +795,6 @@ public int getTreeCount() {
 	public boolean next() throws MissingObjectException,
 			IncorrectObjectTypeException, CorruptObjectException, IOException {
 		try {
-			attrs = null;
 			if (advance) {
 				advance = false;
 				postChildren = false;
@@ -803,6 +802,7 @@ public boolean next() throws MissingObjectException,
 			}
 
 			for (;;) {
+				attrs = null;
 				final AbstractTreeIterator t = min();
 				if (t.eof()) {
 					if (depth > 0) {
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/HttpSupport.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/HttpSupport.java
index 7cb2bf6..202645b 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/util/HttpSupport.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/HttpSupport.java
@@ -190,7 +190,7 @@ public static int response(final HttpConnection c) throws IOException {
 			return c.getResponseCode();
 		} catch (ConnectException ce) {
 			final URL url = c.getURL();
-			final String host = (url == null) ? "<null>" : url.getHost();
+			final String host = (url == null) ? "<null>" : url.getHost(); //$NON-NLS-1$
 			// The standard J2SE error message is not very useful.
 			//
 			if ("Connection timed out: connect".equals(ce.getMessage())) //$NON-NLS-1$
@@ -218,7 +218,7 @@ public static int response(final java.net.HttpURLConnection c)
 			return c.getResponseCode();
 		} catch (ConnectException ce) {
 			final URL url = c.getURL();
-			final String host = (url == null) ? "<null>" : url.getHost();
+			final String host = (url == null) ? "<null>" : url.getHost(); //$NON-NLS-1$
 			// The standard J2SE error message is not very useful.
 			//
 			if ("Connection timed out: connect".equals(ce.getMessage())) //$NON-NLS-1$
diff --git a/pom.xml b/pom.xml
index 81c04ce..d256bbb 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.4.1-SNAPSHOT</version>
+  <version>4.5.0-SNAPSHOT</version>
 
   <name>JGit - Parent</name>
   <url>${jgit-url}</url>