mirror of
https://github.com/desktop/desktop
synced 2024-09-19 08:02:22 +00:00
Merge branch 'master' into changelog-for-1-3-0
This commit is contained in:
commit
572c1da0b1
|
@ -722,7 +722,7 @@ export class GitStore extends BaseStore {
|
|||
}
|
||||
|
||||
/**
|
||||
* The commit message to use based on the contex of the repository, e.g., the
|
||||
* The commit message to use based on the context of the repository, e.g., the
|
||||
* message from a recently undone commit.
|
||||
*/
|
||||
public get contextualCommitMessage(): ICommitMessage | null {
|
||||
|
|
|
@ -45,7 +45,7 @@ interface IChangesListProps {
|
|||
summary: string,
|
||||
description: string | null,
|
||||
trailers?: ReadonlyArray<ITrailer>
|
||||
) => Promise<void>
|
||||
) => Promise<boolean>
|
||||
readonly onDiscardChanges: (file: WorkingDirectoryFileChange) => void
|
||||
readonly askForConfirmationOnDiscardChanges: boolean
|
||||
readonly onDiscardAllChanges: (
|
||||
|
|
|
@ -38,7 +38,7 @@ interface ICommitMessageProps {
|
|||
summary: string,
|
||||
description: string | null,
|
||||
trailers?: ReadonlyArray<ITrailer>
|
||||
) => Promise<void>
|
||||
) => Promise<boolean>
|
||||
readonly branch: string | null
|
||||
readonly commitAuthor: CommitIdentity | null
|
||||
readonly gitHubUser: IGitHubUser | null
|
||||
|
@ -224,8 +224,16 @@ export class CommitMessage extends React.Component<
|
|||
this.setState({ description })
|
||||
}
|
||||
|
||||
private onSubmit = () => {
|
||||
this.createCommit()
|
||||
private clearCommitMessage() {
|
||||
this.setState({ summary: '', description: null })
|
||||
}
|
||||
|
||||
private onSubmit = async () => {
|
||||
const commitCreated = await this.createCommit()
|
||||
|
||||
if (commitCreated) {
|
||||
this.clearCommitMessage()
|
||||
}
|
||||
}
|
||||
|
||||
private getCoAuthorTrailers() {
|
||||
|
@ -239,16 +247,16 @@ export class CommitMessage extends React.Component<
|
|||
}))
|
||||
}
|
||||
|
||||
private async createCommit() {
|
||||
private async createCommit(): Promise<boolean> {
|
||||
const { summary, description } = this.state
|
||||
|
||||
if (!this.canCommit()) {
|
||||
return
|
||||
return false
|
||||
}
|
||||
|
||||
const trailers = this.getCoAuthorTrailers()
|
||||
|
||||
await this.props.onCreateCommit(summary, description, trailers)
|
||||
return await this.props.onCreateCommit(summary, description, trailers)
|
||||
}
|
||||
|
||||
private canCommit(): boolean {
|
||||
|
|
|
@ -116,7 +116,7 @@ export class ChangesSidebar extends React.Component<IChangesSidebarProps, {}> {
|
|||
summary: string,
|
||||
description: string | null,
|
||||
trailers?: ReadonlyArray<ITrailer>
|
||||
): Promise<void> => {
|
||||
): Promise<boolean> => {
|
||||
const commitCreated = await this.props.dispatcher.commitIncludedChanges(
|
||||
this.props.repository,
|
||||
summary,
|
||||
|
@ -127,6 +127,8 @@ export class ChangesSidebar extends React.Component<IChangesSidebarProps, {}> {
|
|||
if (commitCreated) {
|
||||
this.props.dispatcher.setCommitMessage(this.props.repository, null)
|
||||
}
|
||||
|
||||
return commitCreated
|
||||
}
|
||||
|
||||
private onFileSelectionChanged = (rows: ReadonlyArray<number>) => {
|
||||
|
|
|
@ -23,6 +23,8 @@
|
|||
"[Improved] Diff gutter elements should be considered button elements when interacting - #5158",
|
||||
"[Improved] Repository list badge style tweaks and tweaks for dark theme - #5095",
|
||||
"[Improved] Status parsing significantly more performant when handling thousands of changed files - #2449 #5186"
|
||||
"1.3.0-beta6": [
|
||||
|
||||
],
|
||||
"1.3.0-beta5": [
|
||||
"[Fixed] Ensure commit message is cleared after successful commit - #4046",
|
||||
|
|
Loading…
Reference in a new issue