mirror of
https://github.com/desktop/desktop
synced 2024-09-13 21:31:32 +00:00
Just like when undoing a commit, make sure message from commit to amend is restored
This logic is copied from GitStore's `undoCommit`
This commit is contained in:
parent
b83fd3f6cf
commit
204fbe92f7
|
@ -4860,7 +4860,7 @@ export class AppStore extends TypedBaseStore<IAppState> {
|
|||
)
|
||||
|
||||
const gitStore = this.gitStoreCache.get(repository)
|
||||
await gitStore.restoreCoAuthorsFromCommit(commit)
|
||||
await gitStore.prepareToAmendCommit(commit)
|
||||
|
||||
this.setRepositoryCommitToAmend(repository, commit)
|
||||
|
||||
|
|
|
@ -716,7 +716,20 @@ export class GitStore extends BaseStore {
|
|||
this.emitUpdate()
|
||||
}
|
||||
|
||||
public async restoreCoAuthorsFromCommit(commit: Commit) {
|
||||
public async prepareToAmendCommit(commit: Commit) {
|
||||
const coAuthorsRestored = await this.restoreCoAuthorsFromCommit(commit)
|
||||
if (coAuthorsRestored) {
|
||||
return
|
||||
}
|
||||
|
||||
this._commitMessage = {
|
||||
summary: commit.summary,
|
||||
description: commit.body,
|
||||
}
|
||||
this.emitUpdate()
|
||||
}
|
||||
|
||||
private async restoreCoAuthorsFromCommit(commit: Commit) {
|
||||
// Let's be safe about this since it's untried waters.
|
||||
// If we can restore co-authors then that's fantastic
|
||||
// but if we can't we shouldn't be throwing an error,
|
||||
|
|
Loading…
Reference in a new issue