Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 72ce1f4

Browse files
authored
Merge branch 'master' into sm-message
2 parents 3743c2f + 2e317ec commit 72ce1f4

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

lib/controllers/commit-view-controller.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,10 @@ export default class CommitViewController {
206206

207207
closeAllOpenCommitMessageEditors() {
208208
this.props.workspace.getPanes().forEach(pane => {
209-
pane.getItems().forEach(item => {
209+
pane.getItems().forEach(async item => {
210210
if (item && item.getPath && item.getPath() === this.getCommitMessagePath()) {
211-
if (!pane.destroyItem(item)) {
211+
const destroyed = await pane.destroyItem(item);
212+
if (!destroyed) {
212213
pane.activateItem(item);
213214
}
214215
}

test/controllers/commit-view-controller.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ describe('CommitViewController', function() {
160160
assert.equal(editor.getText(), 'message in box');
161161

162162
editor.setText('message in editor');
163-
editor.save();
163+
await editor.save();
164164

165165
commandRegistry.dispatch(atomEnvironment.views.getView(editor), 'pane:split-right-and-copy-active-item');
166166
await assert.async.notEqual(workspace.getActiveTextEditor(), editor);
@@ -237,7 +237,7 @@ describe('CommitViewController', function() {
237237
assert.equal(editor.getPath(), controller.getCommitMessagePath());
238238

239239
editor.setText('message in editor');
240-
editor.save();
240+
await editor.save();
241241
commandRegistry.dispatch(atomEnvironment.views.getView(workspace), 'github:commit');
242242

243243
await assert.async.equal((await repository.getLastCommit()).getMessage(), 'message in editor');

test/models/workspace-change-observer.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ describe('WorkspaceChangeObserver', function() {
6060
await changeObserver.start();
6161

6262
editor.setText('change');
63-
editor.save();
63+
await editor.save();
6464
await until(() => changeSpy.calledOnce);
6565

6666
changeSpy.reset();
@@ -86,7 +86,7 @@ describe('WorkspaceChangeObserver', function() {
8686
editor.getBuffer().setPath(path.join(workdirPath, 'renamed-path.txt'));
8787

8888
editor.setText('change');
89-
editor.save();
89+
await editor.save();
9090
await assert.async.isTrue(changeSpy.calledWith([{
9191
directory: workdirPath,
9292
file: 'renamed-path.txt',

0 commit comments

Comments
 (0)