Merge remote-tracking branch 'origin/1.4.x'

This commit is contained in:
Ryan Baxter
2018-04-02 13:29:22 -05:00
2 changed files with 3 additions and 2 deletions

View File

@@ -218,7 +218,7 @@ public class JGitEnvironmentRepository extends AbstractScmEnvironmentRepository
git = createGitClient();
if (shouldPull(git)) {
FetchResult fetchStatus = fetch(git, label);
if(deleteUntrackedBranches) {
if (deleteUntrackedBranches && fetchStatus != null) {
deleteUntrackedLocalBranches(fetchStatus.getTrackingRefUpdates(), git);
}
// checkout after fetch so we can get any new branches, tags, ect.
@@ -267,7 +267,7 @@ public class JGitEnvironmentRepository extends AbstractScmEnvironmentRepository
/**
* Clones the remote repository and then opens a connection to it.
*
*
* @throws GitAPIException
* @throws IOException
*/

View File

@@ -339,6 +339,7 @@ public class JGitEnvironmentRepositoryTests {
CloneCommand cloneCommand = mock(CloneCommand.class);
MockGitFactory factory = new MockGitFactory(git, cloneCommand);
this.repository.setGitFactory(factory);
this.repository.setDeleteUntrackedBranches(true);
// refresh()->shouldPull
StatusCommand statusCommand = mock(StatusCommand.class);