mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-86695 Git cherry-pick changes not committed - trying to debug
Don't silently ignore the fact of invalid CheckinEnvironment or empty list to commit, but log an error.
This commit is contained in:
@@ -142,6 +142,7 @@ public class GitCheckinEnvironment implements CheckinEnvironment {
|
||||
@NotNull NullableFunction<Object, Object> parametersHolder, Set<String> feedback) {
|
||||
List<VcsException> exceptions = new ArrayList<VcsException>();
|
||||
Map<VirtualFile, Collection<Change>> sortedChanges = sortChangesByGitRoot(changes, exceptions);
|
||||
log.assertTrue(!sortedChanges.isEmpty(), "Trying to commit an empty list of changes: " + changes);
|
||||
if (GitFileSeparatorConverter.convertSeparatorsIfNeeded(myProject, mySettings, sortedChanges, exceptions)) {
|
||||
for (Map.Entry<VirtualFile, Collection<Change>> entry : sortedChanges.entrySet()) {
|
||||
Set<FilePath> files = new HashSet<FilePath>();
|
||||
|
||||
@@ -497,21 +497,20 @@ public class GitCherryPicker {
|
||||
final Collection<Document> committingDocs = markCommittingDocs();
|
||||
try {
|
||||
CheckinEnvironment ce = myPlatformFacade.getVcs(myProject).getCheckinEnvironment();
|
||||
if (ce != null && ce instanceof GitCheckinEnvironment) {
|
||||
try {
|
||||
((GitCheckinEnvironment)ce).reset();
|
||||
List<VcsException> exceptions = ce.commit(myChanges, myCommitMessage);
|
||||
VcsDirtyScopeManager.getInstance(myProject).filePathsDirty(ChangesUtil.getPaths(myChanges), null);
|
||||
if (exceptions != null && !exceptions.isEmpty()) {
|
||||
VcsException exception = exceptions.get(0);
|
||||
handleError(exception);
|
||||
}
|
||||
}
|
||||
catch (Throwable e) {
|
||||
LOG.error(e);
|
||||
handleError(e);
|
||||
LOG.assertTrue(ce != null && ce instanceof GitCheckinEnvironment, "Invalid CheckinEnvironment: " + ce);
|
||||
try {
|
||||
((GitCheckinEnvironment)ce).reset();
|
||||
List<VcsException> exceptions = ce.commit(myChanges, myCommitMessage);
|
||||
VcsDirtyScopeManager.getInstance(myProject).filePathsDirty(ChangesUtil.getPaths(myChanges), null);
|
||||
if (exceptions != null && !exceptions.isEmpty()) {
|
||||
VcsException exception = exceptions.get(0);
|
||||
handleError(exception);
|
||||
}
|
||||
}
|
||||
catch (Throwable e) {
|
||||
LOG.error(e);
|
||||
handleError(e);
|
||||
}
|
||||
}
|
||||
finally {
|
||||
unmarkCommittingDocs(committingDocs);
|
||||
|
||||
Reference in New Issue
Block a user