Upgrade JGit to 4.3.0.201604071810-r

this version brings the following fixes

- Fix jgit gc which retained garbage packs for 2 weeks which resulted
in repo size explosion [1] by introducing a new option for pack expiration
which by default expires packs after 1 hour

- Fix refcounting and reclaiming memory in RepositoryCache. Hugo
validated that this reduces memory consumption in Gerrit considerably

- Make the FileLfsRepository thread safe. This fixes a severe threading
issue for the lfs-storage-fs plugin [2]

Requires disabling atomic updates on InMemoryRepositoryMangers
used by acceptance tests because of this change [3] in JGit, lines
269-286. This creates an anonymous subclass of BatchRefUpdate and when
running Gerrit's tests the code always enters the if-branch which
doesn't update the progress monitor. Since the progress monitor is not
updated the "refs: 1" is missing from the output and the assertion in
the line 469 fails.

When running normal (not from tests) Gerrit daemon this JGit code is
not used and the issue doesn't exist.

This is an intermediate step to upgrading to 4.5.4.201711221230-r which
keeps the branch building and tests passing.

Atomic update bug description re-worded from Saša Živkov's comment on [4].

[1] https://groups.google.com/forum/#!searchin/repo-discuss/gc/repo-discuss/JW06GsH0vLo/9GV4TL0VDgAJ
[2] https://git.eclipse.org/r/#/c/52177/16/org.eclipse.jgit.lfs.server/src/org/eclipse/jgit/lfs/server/fs/FileLfsServlet.java
[3] https://git.eclipse.org/r/#/c/61841/2/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/InMemoryRepository.java
[4] https://gerrit-review.googlesource.com/c/gerrit/+/77110/1/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/git/AbstractPushForReview.java#b496

Change-Id: If6ba90c5e79747d20338ad32f03624a6bd75ee43
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
diff --git a/gerrit-server/src/test/java/com/google/gerrit/testutil/InMemoryRepositoryManager.java b/gerrit-server/src/test/java/com/google/gerrit/testutil/InMemoryRepositoryManager.java
index ec53b29..656185d 100644
--- a/gerrit-server/src/test/java/com/google/gerrit/testutil/InMemoryRepositoryManager.java
+++ b/gerrit-server/src/test/java/com/google/gerrit/testutil/InMemoryRepositoryManager.java
@@ -53,6 +53,9 @@
   public static class Repo extends InMemoryRepository {
     private Repo(Project.NameKey name) {
       super(new Description(name));
+      // TODO(dborowitz): Allow atomic transactions when this is supported:
+      // https://git.eclipse.org/r/#/c/61841/2/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/InMemoryRepository.java@313
+      setPerformsAtomicTransactions(false);
     }
 
     @Override
diff --git a/lib/jgit/BUCK b/lib/jgit/BUCK
index a26f076..3bf8f34 100644
--- a/lib/jgit/BUCK
+++ b/lib/jgit/BUCK
@@ -1,13 +1,13 @@
 include_defs('//lib/maven.defs')
 
 REPO = MAVEN_CENTRAL # Leave here even if set to MAVEN_CENTRAL.
-VERS = '4.1.2.201602141800-r'
+VERS = '4.3.0.201604071810-r'
 
 maven_jar(
   name = 'jgit',
   id = 'org.eclipse.jgit:org.eclipse.jgit:' + VERS,
-  bin_sha1 = '123620d124bbea23b7ee2d8ec3eccbb59c7be921',
-  src_sha1 = '6d3b5c60170d6df3dd74cf4948d7f16feb390333',
+  bin_sha1 = 'e3c57967fb8df5172d62bb4bbbd355554db4c65d',
+  src_sha1 = '4d64b05a50d581a2884a5b7dc66163be18bac755',
   license = 'jgit',
   repository = REPO,
   unsign = True,
@@ -22,7 +22,7 @@
 maven_jar(
   name = 'jgit-servlet',
   id = 'org.eclipse.jgit:org.eclipse.jgit.http.server:' + VERS,
-  sha1 = '76bf6924f0668abc65f9c4aa88492ee0a9d59544',
+  sha1 = '516925ff0df67705e368c905a910ed982655cc32',
   license = 'jgit',
   repository = REPO,
   deps = [':jgit'],
@@ -36,7 +36,7 @@
 maven_jar(
   name = 'jgit-archive',
   id = 'org.eclipse.jgit:org.eclipse.jgit.archive:' + VERS,
-  sha1 = '94a29ae139c9965ad95d3e14f5fd3a6ff28a7910',
+  sha1 = 'c065b765aac56cdbe531634fdfd829a6ce8bbd0c',
   license = 'jgit',
   repository = REPO,
   deps = [':jgit',
@@ -53,7 +53,7 @@
 maven_jar(
   name = 'junit',
   id = 'org.eclipse.jgit:org.eclipse.jgit.junit:' + VERS,
-  sha1 = '9ee5941c42e3991b1a90f35e9de63854c4b5c474',
+  sha1 = '060a98c260b23f64c47e3fb4d77b684ccb64c114',
   license = 'DO_NOT_DISTRIBUTE',
   repository = REPO,
   unsign = True,