]> source.dussan.org Git - jgit.git/commit
RefDatabase/Ref: Add versioning to reference database 92/133092/20
authorIvan Frade <ifrade@google.com>
Thu, 20 Dec 2018 00:43:56 +0000 (16:43 -0800)
committerIvan Frade <ifrade@google.com>
Wed, 26 Dec 2018 17:42:59 +0000 (09:42 -0800)
commit6ea888a036467649fb4d6be9182599bbef879a6d
tree6b3a0feb019021127bb6fde52630b015897e0e03
parentd09388e156fb0b69deb0f3da17b303a851825818
RefDatabase/Ref: Add versioning to reference database

In DFS implementations the reference table can fall out of sync, but
it is not possible to check this situation in the current API.

Add a property to the Refs indicating the order of its updates.  This
version is set only by RefDatabase implementations that support
versioning (e.g reftable based).

Caller is responsible to check if the reference db creates versioned
refs before accessing getUpdateIndex(). E.g:

   Ref ref = refdb.exactRef(...);
   if (refdb.hasVersioning()) {
       ref.getUpdateIndex();
   }

Change-Id: I0d5ec8e8df47c730301b2e12851a6bf3dac9d120
Signed-off-by: Ivan Frade <ifrade@google.com>
14 files changed:
org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/RefDirectoryTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/reftable/MergedReftableTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/reftable/ReftableCompactorTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/reftable/ReftableTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ObjectIdRefTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/SymbolicRefTest.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsReftableDatabase.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/reftable/BlockReader.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/reftable/Reftable.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/reftable/ReftableReader.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectIdRef.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/Ref.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/RefDatabase.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/SymbolicRef.java