Skip to content

Commit

Permalink
GH-1894: Fixed bug when undoing a commit.
Browse files Browse the repository at this point in the history
 - The `message` property of the Git widget was not set when undoing.
This commit sets the `message` so the validation can pass.
 - I have also removed an obsolete property.

Closes #1894.

Signed-off-by: Akos Kitta <kittaakos@gmail.com>
  • Loading branch information
kittaakos committed May 12, 2018
1 parent 2751e6a commit a84e6fe
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/git/src/browser/git-widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ export class GitWidget extends VirtualWidget {
protected unstagedChanges: GitFileChangeNode[] = [];
protected mergeChanges: GitFileChangeNode[] = [];
protected message: string = '';
protected messageInputHighlighted: boolean = false;
protected status: WorkingDirectoryStatus | undefined;
protected scrollContainer: string;
protected commitMessageValidationResult: GitCommitMessageValidator.Result | undefined;
Expand Down Expand Up @@ -104,6 +103,7 @@ export class GitWidget extends VirtualWidget {
const commitTextArea = document.getElementById('theia-git-commit-message') as HTMLTextAreaElement;
await this.git.exec(selectedRepository, ['reset', 'HEAD~', '--soft']);
if (commitTextArea) {
this.message = message;
commitTextArea.value = message;
this.resize(commitTextArea);
commitTextArea.focus();
Expand All @@ -129,7 +129,6 @@ export class GitWidget extends VirtualWidget {
// need to access the element, because Phosphor.js is not updating `value`but only `setAttribute('value', ....)` which only sets the default value.
const messageInput = document.getElementById('theia-git-commit-message') as HTMLInputElement;
if (messageInput) {
this.messageInputHighlighted = true;
this.update();
messageInput.focus();
}
Expand Down

0 comments on commit a84e6fe

Please sign in to comment.