diff --git a/app/src/lib/app-state.ts b/app/src/lib/app-state.ts index 3ec85adc2f8..e97835cb970 100644 --- a/app/src/lib/app-state.ts +++ b/app/src/lib/app-state.ts @@ -232,6 +232,9 @@ export interface IAppState { /** Should the app prompt the user to confirm an undo commit? */ readonly askForConfirmationOnUndoCommit: boolean + /** Should the app prompt the user to confirm they want to commit with changes are hidden by filter? */ + readonly askForConfirmationOnCommitFilteredChanges: boolean + /** How the app should handle uncommitted changes when switching branches */ readonly uncommittedChangesStrategy: UncommittedChangesStrategy diff --git a/app/src/lib/stores/app-store.ts b/app/src/lib/stores/app-store.ts index 0f3da9ffda8..c099e54516b 100644 --- a/app/src/lib/stores/app-store.ts +++ b/app/src/lib/stores/app-store.ts @@ -379,6 +379,7 @@ const confirmDiscardStashDefault: boolean = true const confirmCheckoutCommitDefault: boolean = true const askForConfirmationOnForcePushDefault = true const confirmUndoCommitDefault: boolean = true +const confirmCommitFilteredChangesDefault: boolean = true const askToMoveToApplicationsFolderKey: string = 'askToMoveToApplicationsFolder' const confirmRepoRemovalKey: string = 'confirmRepoRemoval' const showCommitLengthWarningKey: string = 'showCommitLengthWarning' @@ -389,6 +390,8 @@ const confirmDiscardChangesPermanentlyKey: string = 'confirmDiscardChangesPermanentlyKey' const confirmForcePushKey: string = 'confirmForcePush' const confirmUndoCommitKey: string = 'confirmUndoCommit' +const confirmCommitFilteredChangesKey: string = + 'confirmCommitFilteredChangesKey' const uncommittedChangesStrategyKey = 'uncommittedChangesStrategyKind' @@ -518,6 +521,8 @@ export class AppStore extends TypedBaseStore { private confirmCheckoutCommit: boolean = confirmCheckoutCommitDefault private askForConfirmationOnForcePush = askForConfirmationOnForcePushDefault private confirmUndoCommit: boolean = confirmUndoCommitDefault + private confirmCommitFilteredChanges: boolean = + confirmCommitFilteredChangesDefault private imageDiffType: ImageDiffType = imageDiffTypeDefault private hideWhitespaceInChangesDiff: boolean = hideWhitespaceInChangesDiffDefault @@ -1041,6 +1046,8 @@ export class AppStore extends TypedBaseStore { askForConfirmationOnCheckoutCommit: this.confirmCheckoutCommit, askForConfirmationOnForcePush: this.askForConfirmationOnForcePush, askForConfirmationOnUndoCommit: this.confirmUndoCommit, + askForConfirmationOnCommitFilteredChanges: + this.confirmCommitFilteredChanges, uncommittedChangesStrategy: this.uncommittedChangesStrategy, selectedExternalEditor: this.selectedExternalEditor, imageDiffType: this.imageDiffType, @@ -2211,6 +2218,11 @@ export class AppStore extends TypedBaseStore { confirmUndoCommitDefault ) + this.confirmCommitFilteredChanges = getBoolean( + confirmCommitFilteredChangesKey, + confirmCommitFilteredChangesDefault + ) + this.uncommittedChangesStrategy = getEnum(uncommittedChangesStrategyKey, UncommittedChangesStrategy) ?? defaultUncommittedChangesStrategy @@ -5771,6 +5783,15 @@ export class AppStore extends TypedBaseStore { return Promise.resolve() } + public _setConfirmCommitFilteredChanges(value: boolean): Promise { + this.confirmCommitFilteredChanges = value + setBoolean(confirmCommitFilteredChangesKey, value) + + this.emitUpdate() + + return Promise.resolve() + } + public _setUncommittedChangesStrategySetting( value: UncommittedChangesStrategy ): Promise { diff --git a/app/src/models/popup.ts b/app/src/models/popup.ts index 9191b3a94e8..ea89afafc5e 100644 --- a/app/src/models/popup.ts +++ b/app/src/models/popup.ts @@ -95,6 +95,7 @@ export enum PopupType { PullRequestComment = 'PullRequestComment', UnknownAuthors = 'UnknownAuthors', TestIcons = 'TestIcons', + ConfirmCommitFilteredChanges = 'ConfirmCommitFilteredChanges', } interface IBasePopup { @@ -423,5 +424,10 @@ export type PopupDetail = | { type: PopupType.TestIcons } + | { + type: PopupType.ConfirmCommitFilteredChanges + onCommitAnyway: () => void + onClearFilter: () => void + } export type Popup = IBasePopup & PopupDetail diff --git a/app/src/ui/app.tsx b/app/src/ui/app.tsx index db2cc8fe977..65ba4e12a4c 100644 --- a/app/src/ui/app.tsx +++ b/app/src/ui/app.tsx @@ -181,6 +181,7 @@ import { accessibilityBannerDismissed } from './banners/accessibilty-settings-ba import { isCertificateErrorSuppressedFor } from '../lib/suppress-certificate-error' import { webUtils } from 'electron' import { showTestUI } from './lib/test-ui-components/test-ui-components' +import { ConfirmCommitFilteredChanges } from './changes/confirm-commit-filtered-changes-dialog' const MinuteInMilliseconds = 1000 * 60 const HourInMilliseconds = MinuteInMilliseconds * 60 @@ -1557,6 +1558,9 @@ export class App extends React.Component { } confirmForcePush={this.state.askForConfirmationOnForcePush} confirmUndoCommit={this.state.askForConfirmationOnUndoCommit} + askForConfirmationOnCommitFilteredChanges={ + this.state.askForConfirmationOnCommitFilteredChanges + } uncommittedChangesStrategy={this.state.uncommittedChangesStrategy} selectedExternalEditor={this.state.selectedExternalEditor} useWindowsOpenSSH={this.state.useWindowsOpenSSH} @@ -2482,11 +2486,27 @@ export class App extends React.Component { /> ) } + case PopupType.ConfirmCommitFilteredChanges: { + return ( + + ) + } default: return assertNever(popup, `Unknown popup type: ${popup}`) } } + private setConfirmCommitFilteredChanges = (value: boolean) => { + this.props.dispatcher.setConfirmCommitFilteredChanges(value) + } + private getPullRequestState() { const { selectedState } = this.state if ( @@ -3225,6 +3245,9 @@ export class App extends React.Component { askForConfirmationOnCheckoutCommit={ state.askForConfirmationOnCheckoutCommit } + askForConfirmationOnCommitFilteredChanges={ + state.askForConfirmationOnCommitFilteredChanges + } accounts={state.accounts} isExternalEditorAvailable={ state.useCustomEditor || state.selectedExternalEditor !== null diff --git a/app/src/ui/changes/commit-message.tsx b/app/src/ui/changes/commit-message.tsx index bbe9bfc1716..9e002c39710 100644 --- a/app/src/ui/changes/commit-message.tsx +++ b/app/src/ui/changes/commit-message.tsx @@ -69,11 +69,19 @@ const addAuthorIcon: OcticonSymbolVariant = { ], } +interface ICreateCommitOptions { + warnUnknownAuthors: boolean + warnFilesNotVisible: boolean +} + interface ICommitMessageProps { readonly onCreateCommit: (context: ICommitContext) => Promise readonly branch: string | null readonly commitAuthor: CommitIdentity | null readonly anyFilesSelected: boolean + /** Whether the user can see all the files to commit in the changes list. They + * may not be able to if the list is filtered */ + readonly showPromptForCommittingFileHiddenByFilter?: boolean readonly isShowingModal: boolean readonly isShowingFoldout: boolean @@ -161,7 +169,8 @@ interface ICommitMessageProps { readonly onCommitSpellcheckEnabledChanged: (enabled: boolean) => void readonly onStopAmending: () => void readonly onShowCreateForkDialog: () => void - + readonly onFilesToCommitNotVisible?: (onCommitAnyway: () => {}) => void + readonly onSuccessfulCommitCreated?: () => void readonly accounts: ReadonlyArray } @@ -498,26 +507,24 @@ export class CommitMessage extends React.Component< : this.state.summary } - private forceCreateCommit = async () => { - return this.createCommit(false) - } - - private async createCommit(warnUnknownAuthors: boolean = true) { + private async createCommit(options?: ICreateCommitOptions) { const { description } = this.state if (!this.canCommit() && !this.canAmend()) { return } - if (warnUnknownAuthors) { + if (options?.warnUnknownAuthors !== false) { const unknownAuthors = this.props.coAuthors.filter( (author): author is UnknownAuthor => !isKnownAuthor(author) ) if (unknownAuthors.length > 0) { - this.props.onConfirmCommitWithUnknownCoAuthors( - unknownAuthors, - this.forceCreateCommit + this.props.onConfirmCommitWithUnknownCoAuthors(unknownAuthors, () => + this.createCommit({ + warnUnknownAuthors: false, + warnFilesNotVisible: options?.warnFilesNotVisible === true, + }) ) return } @@ -532,11 +539,26 @@ export class CommitMessage extends React.Component< amend: this.props.commitToAmend !== null, } + if ( + options?.warnFilesNotVisible !== false && + this.props.showPromptForCommittingFileHiddenByFilter === true && + this.props.onFilesToCommitNotVisible + ) { + this.props.onFilesToCommitNotVisible(() => + this.createCommit({ + warnUnknownAuthors: options?.warnUnknownAuthors === true, + warnFilesNotVisible: false, + }) + ) + return + } + const timer = startTimer('create commit', this.props.repository) const commitCreated = await this.props.onCreateCommit(commitContext) timer.done() if (commitCreated) { + this.props.onSuccessfulCommitCreated?.() this.clearCommitMessage() } } diff --git a/app/src/ui/changes/confirm-commit-filtered-changes-dialog.tsx b/app/src/ui/changes/confirm-commit-filtered-changes-dialog.tsx new file mode 100644 index 00000000000..eb8a49d2ee1 --- /dev/null +++ b/app/src/ui/changes/confirm-commit-filtered-changes-dialog.tsx @@ -0,0 +1,92 @@ +import * as React from 'react' +import { Dialog, DialogContent, DialogFooter } from '../dialog' +import { Row } from '../lib/row' +import { OkCancelButtonGroup } from '../dialog/ok-cancel-button-group' +import { Checkbox, CheckboxValue } from '../lib/checkbox' + +interface IConfirmCommitFilteredChangesProps { + readonly onCommitAnyway: () => void + readonly onDismissed: () => void + readonly onClearFilter: () => void + readonly setConfirmCommitFilteredChanges: (value: boolean) => void +} + +interface IConfirmCommitFilteredChangesState { + readonly askForConfirmationOnCommitFilteredChanges: boolean +} + +export class ConfirmCommitFilteredChanges extends React.Component< + IConfirmCommitFilteredChangesProps, + IConfirmCommitFilteredChangesState +> { + public constructor(props: IConfirmCommitFilteredChangesProps) { + super(props) + + this.state = { + askForConfirmationOnCommitFilteredChanges: true, + } + } + + public render() { + return ( + + +

+ You have a filter applied. There are changes that will be committed + hidden from view. Are you sure you want to commit these changes? +

+ + + +
+ + + +
+ ) + } + + private onShowMessageChange = (event: React.FormEvent) => { + const value = !event.currentTarget.checked + + this.setState({ askForConfirmationOnCommitFilteredChanges: value }) + } + + private onClearFilter = () => { + this.props.onClearFilter() + this.props.onDismissed() + } + + private onSubmit = () => { + this.props.setConfirmCommitFilteredChanges( + this.state.askForConfirmationOnCommitFilteredChanges + ) + this.props.onCommitAnyway() + this.props.onDismissed() + } +} diff --git a/app/src/ui/changes/filter-changes-list.tsx b/app/src/ui/changes/filter-changes-list.tsx index 54aab320868..f197118fff0 100644 --- a/app/src/ui/changes/filter-changes-list.tsx +++ b/app/src/ui/changes/filter-changes-list.tsx @@ -51,7 +51,7 @@ import { hasWritePermission } from '../../models/github-repository' import { hasConflictedFiles } from '../../lib/status' import { createObservableRef } from '../lib/observable-ref' import { TooltipDirection } from '../lib/tooltip' -import { Popup } from '../../models/popup' +import { Popup, PopupType } from '../../models/popup' import { EOL } from 'os' import { TooltippedContent } from '../lib/tooltipped-content' import { RepoRulesInfo } from '../../models/repo-rules' @@ -60,6 +60,7 @@ import { StashDiffViewerId } from '../stashing' import { AugmentedSectionFilterList } from '../lib/augmented-filter-list' import { IFilterListGroup, IFilterListItem } from '../lib/filter-list' import { ClickSource } from '../lib/list' +import memoizeOne from 'memoize-one' interface IChangesListItem extends IFilterListItem { readonly id: string @@ -142,6 +143,7 @@ interface IFilterChangesListProps { readonly onCreateCommit: (context: ICommitContext) => Promise readonly onDiscardChanges: (file: WorkingDirectoryFileChange) => void readonly askForConfirmationOnDiscardChanges: boolean + readonly askForConfirmationOnCommitFilteredChanges: boolean readonly focusCommitMessage: boolean readonly isShowingModal: boolean readonly isShowingFoldout: boolean @@ -236,7 +238,7 @@ interface IFilterChangesListProps { interface IFilterChangesListState { readonly filterText: string - readonly filteredItems: ReadonlyArray + readonly filteredItems: Map readonly selectedItems: ReadonlyArray readonly focusedRow: string | null readonly groups: ReadonlyArray> @@ -271,6 +273,31 @@ export class FilterChangesList extends React.Component< IFilterChangesListProps, IFilterChangesListState > { + private isCommittingFileHiddenByFilter = memoizeOne( + ( + filterText: string, + fileIdsIncludedInCommit: ReadonlyArray, + filteredItems: Map, + fileCount: number + ) => { + // All possible files are present in the list (empty filter or all matching filter) + if (filterText === '' || filteredItems.size === fileCount) { + return false + } + + // If filtered rows count is 1 and included for commit rows count is 2, + // there is no way the included for commit rows are visible regardless of + // what they are. + if (fileIdsIncludedInCommit.length > this.state.filteredItems.size) { + return true + } + + // If we can find a file id included in the commit that does not exist in + // the filtered items, then we are committing a hidden file. + return fileIdsIncludedInCommit.some(fId => !filteredItems.get(fId)) + } + ) + private headerRef = createObservableRef() private includeAllCheckBoxRef = React.createRef() @@ -281,7 +308,7 @@ export class FilterChangesList extends React.Component< this.state = { filterText: '', - filteredItems: [], + filteredItems: new Map(), selectedItems: getSelectedItemsFromProps(props), focusedRow: null, groups, @@ -842,6 +869,7 @@ export class FilterChangesList extends React.Component< const anyFilesSelected = fileCount > 0 && includeAllValue !== CheckboxValue.Off + // Files selected to commit (to be committed) (not selected to see in diff) const filesSelected = workingDirectory.files.filter( f => f.selection.getSelectionType() !== DiffSelectionType.None ) @@ -859,6 +887,15 @@ export class FilterChangesList extends React.Component< this.props.repository.gitHubRepository === null || hasWritePermission(this.props.repository.gitHubRepository) + const showPromptForCommittingFileHiddenByFilter = + this.props.askForConfirmationOnCommitFilteredChanges && + this.isCommittingFileHiddenByFilter( + this.state.filterText, + filesSelected.map(f => f.id), + this.state.filteredItems, + fileCount + ) + return ( 0} repository={repository} repositoryAccount={repositoryAccount} @@ -904,11 +944,17 @@ export class FilterChangesList extends React.Component< onCommitSpellcheckEnabledChanged={this.onCommitSpellcheckEnabledChanged} onStopAmending={this.onStopAmending} onShowCreateForkDialog={this.onShowCreateForkDialog} + onFilesToCommitNotVisible={this.onFilesToCommitNotVisible} accounts={this.props.accounts} + onSuccessfulCommitCreated={this.onSuccessfulCommitCreated} /> ) } + private onSuccessfulCommitCreated = () => { + this.clearFilter() + } + private onCoAuthorsUpdated = (coAuthors: ReadonlyArray) => this.props.dispatcher.setCoAuthors(this.props.repository, coAuthors) @@ -1032,9 +1078,9 @@ export class FilterChangesList extends React.Component< private onFilterListResultsChanged = ( filteredItems: ReadonlyArray ) => { - this.setState({ filteredItems }) - // TBD: Remove when used. - console.log(this.state.filteredItems, filteredItems) + const filteredSet = new Map() + filteredItems.forEach(f => filteredSet.set(f.id, f)) + this.setState({ filteredItems: filteredSet }) } private onFileSelectionChanged = (items: ReadonlyArray) => { @@ -1044,6 +1090,18 @@ export class FilterChangesList extends React.Component< this.props.onFileSelectionChanged(rows) } + private onFilesToCommitNotVisible = (onCommitAnyway: () => void) => { + this.props.dispatcher.showPopup({ + type: PopupType.ConfirmCommitFilteredChanges, + onCommitAnyway, + onClearFilter: this.clearFilter, + }) + } + + private clearFilter = () => { + this.setState({ filterText: '' }) + } + public render() { const { workingDirectory, rebaseConflictState, isCommitting } = this.props const { files } = workingDirectory diff --git a/app/src/ui/changes/sidebar.tsx b/app/src/ui/changes/sidebar.tsx index f665a7ad8fe..dfe253d9407 100644 --- a/app/src/ui/changes/sidebar.tsx +++ b/app/src/ui/changes/sidebar.tsx @@ -63,6 +63,7 @@ interface IChangesSidebarProps { readonly gitHubUserStore: GitHubUserStore readonly focusCommitMessage: boolean readonly askForConfirmationOnDiscardChanges: boolean + readonly askForConfirmationOnCommitFilteredChanges: boolean readonly accounts: ReadonlyArray readonly isShowingModal: boolean readonly isShowingFoldout: boolean @@ -421,6 +422,9 @@ export class ChangesSidebar extends React.Component { askForConfirmationOnDiscardChanges={ this.props.askForConfirmationOnDiscardChanges } + askForConfirmationOnCommitFilteredChanges={ + this.props.askForConfirmationOnCommitFilteredChanges + } onDiscardChangesFromFiles={this.onDiscardChangesFromFiles} onOpenItem={this.onOpenItem} onRowClick={this.onChangedItemClick} diff --git a/app/src/ui/dispatcher/dispatcher.ts b/app/src/ui/dispatcher/dispatcher.ts index 622cfce8967..a48001dbbc7 100644 --- a/app/src/ui/dispatcher/dispatcher.ts +++ b/app/src/ui/dispatcher/dispatcher.ts @@ -2437,6 +2437,10 @@ export class Dispatcher { return this.appStore._setConfirmUndoCommitSetting(value) } + public setConfirmCommitFilteredChanges(value: boolean) { + return this.appStore._setConfirmCommitFilteredChanges(value) + } + /** * Converts a local repository to use the given fork * as its default remote and associated `GitHubRepository`. diff --git a/app/src/ui/preferences/preferences.tsx b/app/src/ui/preferences/preferences.tsx index 0cd7cf4649f..485da893886 100644 --- a/app/src/ui/preferences/preferences.tsx +++ b/app/src/ui/preferences/preferences.tsx @@ -67,6 +67,7 @@ interface IPreferencesProps { readonly confirmCheckoutCommit: boolean readonly confirmForcePush: boolean readonly confirmUndoCommit: boolean + readonly askForConfirmationOnCommitFilteredChanges: boolean readonly uncommittedChangesStrategy: UncommittedChangesStrategy readonly selectedExternalEditor: string | null readonly selectedShell: Shell @@ -103,6 +104,7 @@ interface IPreferencesState { readonly confirmCheckoutCommit: boolean readonly confirmForcePush: boolean readonly confirmUndoCommit: boolean + readonly askForConfirmationOnCommitFilteredChanges: boolean readonly uncommittedChangesStrategy: UncommittedChangesStrategy readonly availableEditors: ReadonlyArray readonly useCustomEditor: boolean @@ -177,6 +179,7 @@ export class Preferences extends React.Component< confirmCheckoutCommit: false, confirmForcePush: false, confirmUndoCommit: false, + askForConfirmationOnCommitFilteredChanges: false, uncommittedChangesStrategy: defaultUncommittedChangesStrategy, selectedExternalEditor: this.props.selectedExternalEditor, availableShells: [], @@ -243,6 +246,8 @@ export class Preferences extends React.Component< confirmCheckoutCommit: this.props.confirmCheckoutCommit, confirmForcePush: this.props.confirmForcePush, confirmUndoCommit: this.props.confirmUndoCommit, + askForConfirmationOnCommitFilteredChanges: + this.props.askForConfirmationOnCommitFilteredChanges, uncommittedChangesStrategy: this.props.uncommittedChangesStrategy, availableShells, availableEditors, @@ -476,6 +481,9 @@ export class Preferences extends React.Component< confirmCheckoutCommit={this.state.confirmCheckoutCommit} confirmForcePush={this.state.confirmForcePush} confirmUndoCommit={this.state.confirmUndoCommit} + askForConfirmationOnCommitFilteredChanges={ + this.state.askForConfirmationOnCommitFilteredChanges + } onConfirmRepositoryRemovalChanged={ this.onConfirmRepositoryRemovalChanged } @@ -487,6 +495,9 @@ export class Preferences extends React.Component< this.onConfirmDiscardChangesPermanentlyChanged } onConfirmUndoCommitChanged={this.onConfirmUndoCommitChanged} + onAskForConfirmationOnCommitFilteredChanges={ + this.onAskForConfirmationOnCommitFilteredChanges + } uncommittedChangesStrategy={this.state.uncommittedChangesStrategy} onUncommittedChangesStrategyChanged={ this.onUncommittedChangesStrategyChanged @@ -607,6 +618,10 @@ export class Preferences extends React.Component< this.setState({ confirmUndoCommit: value }) } + private onAskForConfirmationOnCommitFilteredChanges = (value: boolean) => { + this.setState({ askForConfirmationOnCommitFilteredChanges: value }) + } + private onUncommittedChangesStrategyChanged = ( uncommittedChangesStrategy: UncommittedChangesStrategy ) => { @@ -790,6 +805,9 @@ export class Preferences extends React.Component< ) await dispatcher.setConfirmUndoCommitSetting(this.state.confirmUndoCommit) + await dispatcher.setConfirmCommitFilteredChanges( + this.state.askForConfirmationOnCommitFilteredChanges + ) if (this.state.selectedExternalEditor) { await dispatcher.setExternalEditor(this.state.selectedExternalEditor) diff --git a/app/src/ui/preferences/prompts.tsx b/app/src/ui/preferences/prompts.tsx index 599162ca612..dd1c103fd9f 100644 --- a/app/src/ui/preferences/prompts.tsx +++ b/app/src/ui/preferences/prompts.tsx @@ -13,6 +13,7 @@ interface IPromptsPreferencesProps { readonly confirmCheckoutCommit: boolean readonly confirmForcePush: boolean readonly confirmUndoCommit: boolean + readonly askForConfirmationOnCommitFilteredChanges: boolean readonly showCommitLengthWarning: boolean readonly uncommittedChangesStrategy: UncommittedChangesStrategy readonly onConfirmDiscardChangesChanged: (checked: boolean) => void @@ -26,6 +27,7 @@ interface IPromptsPreferencesProps { readonly onUncommittedChangesStrategyChanged: ( value: UncommittedChangesStrategy ) => void + readonly onAskForConfirmationOnCommitFilteredChanges: (value: boolean) => void } interface IPromptsPreferencesState { @@ -36,6 +38,7 @@ interface IPromptsPreferencesState { readonly confirmCheckoutCommit: boolean readonly confirmForcePush: boolean readonly confirmUndoCommit: boolean + readonly askForConfirmationOnCommitFilteredChanges: boolean readonly uncommittedChangesStrategy: UncommittedChangesStrategy } @@ -56,6 +59,8 @@ export class Prompts extends React.Component< confirmForcePush: this.props.confirmForcePush, confirmUndoCommit: this.props.confirmUndoCommit, uncommittedChangesStrategy: this.props.uncommittedChangesStrategy, + askForConfirmationOnCommitFilteredChanges: + this.props.askForConfirmationOnCommitFilteredChanges, } } @@ -113,6 +118,15 @@ export class Prompts extends React.Component< this.props.onConfirmUndoCommitChanged(value) } + private onAskForConfirmationOnCommitFilteredChanges = ( + event: React.FormEvent + ) => { + const value = event.currentTarget.checked + + this.setState({ askForConfirmationOnCommitFilteredChanges: value }) + this.props.onAskForConfirmationOnCommitFilteredChanges(value) + } + private onConfirmRepositoryRemovalChanged = ( event: React.FormEvent ) => { @@ -247,6 +261,15 @@ export class Prompts extends React.Component< } onChange={this.onConfirmUndoCommitChanged} /> + {this.renderSwitchBranchOptions()} diff --git a/app/src/ui/repository.tsx b/app/src/ui/repository.tsx index 5738811ccf4..2ee6862d77f 100644 --- a/app/src/ui/repository.tsx +++ b/app/src/ui/repository.tsx @@ -52,6 +52,7 @@ interface IRepositoryViewProps { readonly showSideBySideDiff: boolean readonly showDiffCheckMarks: boolean readonly askForConfirmationOnDiscardChanges: boolean + readonly askForConfirmationOnCommitFilteredChanges: boolean readonly askForConfirmationOnDiscardStash: boolean readonly askForConfirmationOnCheckoutCommit: boolean readonly focusCommitMessage: boolean @@ -250,6 +251,9 @@ export class RepositoryView extends React.Component< askForConfirmationOnDiscardChanges={ this.props.askForConfirmationOnDiscardChanges } + askForConfirmationOnCommitFilteredChanges={ + this.props.askForConfirmationOnCommitFilteredChanges + } accounts={this.props.accounts} isShowingModal={this.props.isShowingModal} isShowingFoldout={this.props.isShowingFoldout}