]> source.dussan.org Git - jgit.git/commitdiff
Support {get,set}GitwebDescription on InMemoryRepository 10/85010/2
authorShawn Pearce <spearce@spearce.org>
Mon, 14 Nov 2016 21:59:59 +0000 (13:59 -0800)
committerShawn Pearce <spearce@spearce.org>
Mon, 14 Nov 2016 22:40:21 +0000 (14:40 -0800)
This simplifies testing for Gerrit Code Review where
application code is updating the repository description
and the test harness uses InMemoryRepository.

Change-Id: I9fbcc028ae24d90209a862f5f4f03e46bfb71db0

org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/InMemoryRepository.java

index 6f390a4b3b5cc7eb2a901e90386e7cdc79fe3b31..fd213977a8b92db35f0bdb1076cf281d5344e70e 100644 (file)
@@ -16,6 +16,7 @@ import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.locks.ReadWriteLock;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
 
+import org.eclipse.jgit.annotations.Nullable;
 import org.eclipse.jgit.internal.storage.pack.PackExt;
 import org.eclipse.jgit.lib.BatchRefUpdate;
 import org.eclipse.jgit.lib.ObjectId;
@@ -54,6 +55,7 @@ public class InMemoryRepository extends DfsRepository {
 
        private final DfsObjDatabase objdb;
        private final RefDatabase refdb;
+       private String gitwebDescription;
        private boolean performsAtomicTransactions = true;
 
        /**
@@ -94,6 +96,17 @@ public class InMemoryRepository extends DfsRepository {
                performsAtomicTransactions = atomic;
        }
 
+       @Override
+       @Nullable
+       public String getGitwebDescription() {
+               return gitwebDescription;
+       }
+
+       @Override
+       public void setGitwebDescription(@Nullable String d) {
+               gitwebDescription = d;
+       }
+
        private class MemObjDatabase extends DfsObjDatabase {
                private List<DfsPackDescription> packs = new ArrayList<DfsPackDescription>();