From 937d9c82b48e52697d1acd0e93ed3759d1094955 Mon Sep 17 00:00:00 2001 From: Marc Egea i Sala Date: Mon, 23 Nov 2015 16:24:22 +0000 Subject: [PATCH] Update local version after processing snapshots --- .../main/java/uk/ac/ic/wlgitbridge/data/model/DataStore.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/model/DataStore.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/model/DataStore.java index f81b4ddfdb..f06b3bb89a 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/model/DataStore.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/data/model/DataStore.java @@ -42,10 +42,12 @@ public class DataStore { public void updateProjectWithName(String name, Repository repository) throws IOException, SnapshotPostException, GitAPIException { LinkedList snapshots = snapshotFetcher.getSnapshotsForProjectAfterVersion(name, persistentStore.getLatestVersionForProject(name)); + + makeCommitsFromSnapshots(name, repository, snapshots); + if (!snapshots.isEmpty()) { persistentStore.setLatestVersionForProject(name, snapshots.getLast().getVersionID()); } - makeCommitsFromSnapshots(name, repository, snapshots); } private void makeCommitsFromSnapshots(String name, Repository repository, List snapshots) throws IOException, GitAPIException {