mirror of
https://github.com/desktop/desktop
synced 2024-09-20 00:21:23 +00:00
Refactor to reuse wall of text 😂
This commit is contained in:
parent
19c5752505
commit
be3f38cead
|
@ -65,11 +65,7 @@ export class WarnLocalChangesBeforeUndo extends React.Component<
|
|||
some of these changes being lost.
|
||||
<br />
|
||||
<br />
|
||||
Also, undoing a merge commit will apply the changes from the merge
|
||||
into your working directory, and committing again will create an
|
||||
entirely new commit. This means you will lose the merge commit and, as
|
||||
a result, commits from the merged branch could disappear from this
|
||||
branch.
|
||||
{this.getMergeCommitUndoWarningText()}
|
||||
<br />
|
||||
<br />
|
||||
Do you want to continue anyway?
|
||||
|
@ -78,10 +74,7 @@ export class WarnLocalChangesBeforeUndo extends React.Component<
|
|||
} else if (this.props.commit.isMergeCommit) {
|
||||
return (
|
||||
<>
|
||||
Undoing a merge commit will apply the changes from the merge into your
|
||||
working directory, and committing again will create an entirely new
|
||||
commit. This means you will lose the merge commit and, as a result,
|
||||
commits from the merged branch could disappear from this branch.
|
||||
{this.getMergeCommitUndoWarningText()}
|
||||
<br />
|
||||
<br />
|
||||
Do you want to continue anyway?
|
||||
|
@ -97,6 +90,13 @@ export class WarnLocalChangesBeforeUndo extends React.Component<
|
|||
}
|
||||
}
|
||||
|
||||
private getMergeCommitUndoWarningText() {
|
||||
return `Undoing a merge commit will apply the changes from the merge into
|
||||
your working directory, and committing again will create an entirely new
|
||||
commit. This means you will lose the merge commit and, as a result, commits
|
||||
from the merged branch could disappear from this branch.`
|
||||
}
|
||||
|
||||
private onSubmit = async () => {
|
||||
const { dispatcher, repository, commit, onDismissed } = this.props
|
||||
this.setState({ isLoading: true })
|
||||
|
|
Loading…
Reference in a new issue