version not being updated on first request after update (including due to hard resets)

New remote branches
New remote tags
— handling a null ref in should pull no longer needed.
— has added benefit of ensuring the local repo is current in case of git failure.
Returns version for tags (version was null before this change)
New starter code for remote repo testing (where a lot of the complexity lies)
This commit is contained in:
rlynch2
2016-11-03 17:46:35 -07:00
parent 9a3e58e8fe
commit 25a6e2d58d

View File

@@ -174,13 +174,15 @@ public class JGitEnvironmentRepositoryIntegrationTests {
git.add().addFilepattern(".").call();
git.commit().setMessage("Conflicting commit.").call();
git.push().setForce(true).call();
String conflictingCommit = git.log().setMaxCount(1).call().iterator()
.next().getName();
// Reset to the raw branch.
git.reset().setMode(ResetType.HARD).setRef(commitToRevertBeforePull).call();
// Triggers the repository refresh.
locations = repository.getLocations("bar", "test", "raw");
assertEquals(locations.getVersion(), commitToRevertBeforePull);
assertEquals(locations.getVersion(), conflictingCommit);
assertTrue("Local repository is not cleaned after retrieving resources.",
git.status().call().isClean());