mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-153870 don't fail completely if the submodule is not registered
If submodule has changed, it appears as a dir locally changed in the main repository => is among filesToCheckin. Its .git dir is found by GitUtil.gitRoots() because it searches the FS rather than looks into mappings (which is inconsistent, but changing it now is frightening).
This commit is contained in:
@@ -76,8 +76,6 @@ import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
|
||||
import static com.intellij.util.ObjectUtils.assertNotNull;
|
||||
|
||||
public class GitCheckinEnvironment implements CheckinEnvironment {
|
||||
private static final Logger log = Logger.getInstance(GitCheckinEnvironment.class.getName());
|
||||
@NonNls private static final String GIT_COMMIT_MSG_FILE_PREFIX = "git-commit-msg-"; // the file name prefix for commit message file
|
||||
@@ -121,7 +119,11 @@ public class GitCheckinEnvironment implements CheckinEnvironment {
|
||||
LinkedHashSet<String> messages = ContainerUtil.newLinkedHashSet();
|
||||
GitRepositoryManager manager = GitUtil.getRepositoryManager(myProject);
|
||||
for (VirtualFile root : GitUtil.gitRoots(Arrays.asList(filesToCheckin))) {
|
||||
GitRepository repository = assertNotNull(manager.getRepositoryForRoot(root));
|
||||
GitRepository repository = manager.getRepositoryForRoot(root);
|
||||
if (repository == null) { // unregistered nested submodule found by GitUtil.getGitRoot
|
||||
log.warn("Unregistered repository: " + root);
|
||||
continue;
|
||||
}
|
||||
File mergeMsg = repository.getRepositoryFiles().getMergeMessageFile();
|
||||
File squashMsg = repository.getRepositoryFiles().getSquashMessageFile();
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user