Skip to content

Commit

Permalink
Fix broken test
Browse files Browse the repository at this point in the history
  • Loading branch information
kgryte committed Jun 1, 2020
1 parent ab68b01 commit b4d5513
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion src/components/GitPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,12 @@ export class GitPanel extends React.Component<IGitPanelProps, IGitPanelState> {
* @returns a promise which commits the files
*/
commitStagedFiles = async (message: string): Promise<void> => {
let res: boolean;
if (!message) {
return;
}
try {
await this._hasIdentity(this.props.model.pathRepository);
res = await this._hasIdentity(this.props.model.pathRepository);
} catch (err) {
this._log({
severity: 'error',
Expand All @@ -240,6 +241,13 @@ export class GitPanel extends React.Component<IGitPanelProps, IGitPanelState> {
showErrorMessage('Fail to commit', err);
return;
}
if (!res) {
this._log({
severity: 'error',
message: 'Failed to commit changes.'
});
return;
}
this._log({
severity: 'info',
message: 'Committing changes...'
Expand Down
2 changes: 1 addition & 1 deletion src/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export class GitExtension implements IGitExtension {
}
this._removeTask(tid);

if (response.status !== 200) {
if (!response.ok) {
const data = await response.json();
throw new ServerConnection.ResponseError(response, data.message);
}
Expand Down

0 comments on commit b4d5513

Please sign in to comment.