[git] Fix tests on cherry-pick

Process customResultHandler in MockVcsHelper#commit.
This commit is contained in:
Kirill Likhodedov
2012-12-06 16:56:48 +04:00
parent afe5252868
commit d4e2a395eb
@@ -188,7 +188,19 @@ public class MockVcsHelper extends AbstractVcsHelper {
public boolean commitChanges(@NotNull Collection<Change> changes, @NotNull LocalChangeList initialChangeList,
@NotNull String commitMessage, @Nullable CommitResultHandler customResultHandler) {
if (myCommitHandler != null) {
return myCommitHandler.commit(commitMessage);
boolean success = myCommitHandler.commit(commitMessage);
if (customResultHandler != null) {
if (success) {
customResultHandler.onSuccess(commitMessage);
}
else {
customResultHandler.onFailure();
}
}
return success;
}
if (customResultHandler != null) {
customResultHandler.onFailure();
}
return false;
}