]> source.dussan.org Git - jgit.git/commitdiff
Expose RefWriter constructor taking RefList 25/925/2
authorShawn O. Pearce <spearce@spearce.org>
Wed, 23 Jun 2010 00:07:09 +0000 (17:07 -0700)
committerShawn O. Pearce <spearce@spearce.org>
Wed, 23 Jun 2010 23:54:15 +0000 (16:54 -0700)
An implementation might prefer to use the RefList type here, and
RefList is part of our public API.  Expose the constructor so callers
who have a RefList can take advantage of the existing sorting.

Change-Id: I545867f85aa2c479d2d610024ebbe318144709c8
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
org.eclipse.jgit/src/org/eclipse/jgit/lib/RefWriter.java

index 6b0c7b3a9822c0e5e60f3f89d1f744f583031d37..f2738245d4f93d375896a39d97ac9a9ab5d4da02 100644 (file)
@@ -86,8 +86,13 @@ public abstract class RefWriter {
                        this.refs = RefComparator.sort(refs.values());
        }
 
-       RefWriter(RefList<Ref> list) {
-               this.refs = list.asList();
+       /**
+        * @param refs
+        *            the complete set of references. This should have been computed
+        *            by applying updates to the advertised refs already discovered.
+        */
+       public RefWriter(RefList<Ref> refs) {
+               this.refs = refs.asList();
        }
 
        /**