Added TagOps.FETCH_TAGS to the fetch command so we get all tags.
This commit is contained in:
@@ -281,9 +281,10 @@ public class JGitEnvironmentRepository extends AbstractScmEnvironmentRepository
|
||||
}
|
||||
|
||||
private FetchResult fetch(Git git, String label) {
|
||||
FetchCommand fetch = git.fetch()
|
||||
.setRemote("origin")
|
||||
.setTagOpt(TagOpt.FETCH_TAGS);
|
||||
FetchCommand fetch = git.fetch();
|
||||
fetch.setRemote("origin");
|
||||
fetch.setTagOpt(TagOpt.FETCH_TAGS);
|
||||
|
||||
setTimeout(fetch);
|
||||
try {
|
||||
if (hasText(getUsername())) {
|
||||
|
||||
@@ -428,9 +428,17 @@ public class JGitEnvironmentRepositoryIntegrationTests {
|
||||
environment = testData.getRepository().findOne("bar", "staging", "testTag");
|
||||
fooProperty = ConfigServerTestUtils.getProperty(environment, "bar.properties", "foo");
|
||||
assertEquals(fooProperty, "bar");
|
||||
|
||||
//now move the tag and test again
|
||||
serverGit.tag().setName("testTag").setForceUpdate(true).setMessage("Testing a moved tag").call();
|
||||
|
||||
environment = testData.getRepository().findOne("bar", "staging", "testTag");
|
||||
fooProperty = ConfigServerTestUtils.getProperty(environment, "bar.properties", "foo");
|
||||
assertEquals(fooProperty, "testAfterTag");
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test
|
||||
public void testNewCommitID() throws Exception {
|
||||
JGitConfigServerTestData testData = JGitConfigServerTestData.prepareClonedGitRepository(TestConfiguration.class);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user