Преглед изворни кода

Made constructor for pushed snapshot.

Winston Li пре 12 година
родитељ
комит
c9d773b6e8

+ 10 - 0
services/git-bridge/src/uk/ac/ic/wlgitbridge/writelatex/model/Snapshot.java

@@ -6,6 +6,7 @@ import uk.ac.ic.wlgitbridge.writelatex.api.request.getforversion.SnapshotFile;
 import uk.ac.ic.wlgitbridge.writelatex.api.request.getsavedvers.SnapshotInfo;
 import uk.ac.ic.wlgitbridge.writelatex.api.request.getsavedvers.WLUser;
 
+import java.util.LinkedList;
 import java.util.List;
 
 /**
@@ -32,6 +33,15 @@ public class Snapshot implements Comparable<Snapshot> {
         atts = data.getAtts();
     }
 
+    public Snapshot(int versionID) {
+        this.versionID = versionID;
+        comment = "Pushed update";
+        userName = "Anonymous";
+        userEmail = "anonymous@writelatex.com";
+        srcs = new LinkedList<SnapshotFile>();
+        atts = new LinkedList<SnapshotAttachment>();
+    }
+
     public int getVersionID() {
         return versionID;
     }

+ 1 - 1
services/git-bridge/src/uk/ac/ic/wlgitbridge/writelatex/model/WLProject.java

@@ -40,7 +40,7 @@ public class WLProject {
     }
 
     public void putLatestSnapshot(int versionID) {
-        snapshots.put(versionID, null);
+        snapshots.put(versionID, new Snapshot(versionID));
         snapshotFetcher.putLatestVersion(versionID);
         latestSnapshotID = versionID;
     }