]> source.dussan.org Git - jgit.git/commit
reftable: split off generic code from DFS code 01/147301/49
authorHan-Wen Nienhuys <hanwen@google.com>
Thu, 26 Sep 2019 11:40:26 +0000 (13:40 +0200)
committerHan-Wen Nienhuys <hanwen@google.com>
Wed, 16 Oct 2019 17:44:30 +0000 (19:44 +0200)
commit2b1e942729617c45d2cb03b7556ab3d63253f64f
tree902bcb2c59895ef5fcb9e5c5221f551b5a95a0ba
parentd1d8bc30c213e6c416534a02921edada9d50cb25
reftable: split off generic code from DFS code

This introduces ReftableBatchRefUpdate and ReftableDatabase, as
generic classes, with some code moved to DfsReftableBatchRefUpdate and
DfsReftableDatabase.

Clarify thread-safety requirements by asserting locked status in
accessors, and acquiring locks in callers. This does not fix threading
problems, because ReftableBatchRefUpdate already wraps the whole
transaction in a lock.

This also fixes a number of bugs in ReftableBatchRefUpdate:

* non-atomic updates should not bail on first failure

* isNameConflicting should also check for conflicts between names that
  are added and removed in the BatchRefUpdate.

Change-Id: I5ec91173ea9a0aa19da444c8c0b2e0f4e8f88798
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
org.eclipse.jgit.http.test/src/org/eclipse/jgit/http/test/RefsUnreadableInMemoryRepository.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsReftableBatchRefUpdate.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsReftableDatabase.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/ReftableBatchRefUpdate.java [deleted file]
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/reftable/ReftableBatchRefUpdate.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/reftable/ReftableDatabase.java [new file with mode: 0644]