diff options
author | Robin Stocker | 2013-08-09 13:20:04 +0000 |
---|---|---|
committer | Matthias Sohn | 2013-09-23 16:17:10 +0000 |
commit | 6566794ebf0e75e9e3f2cd2501d1793bee3b6870 (patch) | |
tree | f55d6fa0ca914aab172b4e9054e72b7670ea66f3 | |
parent | 457dbbed81501ebe2ac54c762be72d567dc3d65b (diff) | |
download | egit-6566794ebf0e75e9e3f2cd2501d1793bee3b6870.tar.gz egit-6566794ebf0e75e9e3f2cd2501d1793bee3b6870.tar.xz egit-6566794ebf0e75e9e3f2cd2501d1793bee3b6870.zip |
Fix NoWorkTreeException when having bare repo in repo view
Bug: 414772
Change-Id: I293bbac57b38034d17e56327907991ac765c613f
Signed-off-by: Robin Stocker <robin@nibor.org>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
-rw-r--r-- | org.eclipse.egit.core/src/org/eclipse/egit/core/internal/GitRepositoryProviderType.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/GitRepositoryProviderType.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/GitRepositoryProviderType.java index f99578513b..179c983477 100644 --- a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/GitRepositoryProviderType.java +++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/GitRepositoryProviderType.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Chris Aniszczyk and others. + * Copyright (c) 2011, 2013 Chris Aniszczyk and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -40,10 +40,12 @@ public class GitRepositoryProviderType extends RepositoryProviderType { try { Repository[] repositories = Activator.getDefault() .getRepositoryCache().getAllRepositories(); - for (int i = 0; i < repositories.length; i++) { - GitSynchronizeData data = new GitSynchronizeData( - repositories[i], Constants.HEAD, Constants.HEAD, true); - set.add(data); + for (Repository repository : repositories) { + if (!repository.isBare()) { + GitSynchronizeData data = new GitSynchronizeData( + repository, Constants.HEAD, Constants.HEAD, true); + set.add(data); + } } } catch (IOException e) { // do nothing |