Skip to content

Commit

Permalink
Rename discard to force to align with push
Browse files Browse the repository at this point in the history
  • Loading branch information
fcollonval committed Nov 11, 2021
1 parent e98368e commit aec26a4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/commandsAndMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -391,19 +391,19 @@ export function addCommands(
/** Add git pull command */
commands.addCommand(CommandIDs.gitPull, {
label: args =>
args.discard
args.force
? trans.__('Pull from Remote (Force)')
: trans.__('Pull from Remote'),
caption: args =>
args.discard
args.force
? trans.__(
'Discard all current changes and pull from remote repository'
)
: trans.__('Pull latest code from remote repository'),
isEnabled: () => gitModel.pathRepository !== null,
execute: async args => {
try {
if (args.discard) {
if (args.force) {
await discardAllChanges(gitModel, trans, args.fallback as boolean);
}
logger.log({
Expand Down Expand Up @@ -438,7 +438,7 @@ export function addCommands(
)
) {
await commands.execute(CommandIDs.gitPull, {
discard: true,
force: true,
fallback: true
});
} else {
Expand Down Expand Up @@ -1197,7 +1197,7 @@ export function createGitMenu(
menu.addItem({ command, args: { force: true } });
}
if (command === CommandIDs.gitPull) {
menu.addItem({ command, args: { discard: true } });
menu.addItem({ command, args: { force: true } });
}
});

Expand Down
4 changes: 2 additions & 2 deletions src/components/FileList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { ContextCommandIDs, CommandIDs, Git } from '../tokens';
import { ActionButton } from './ActionButton';
import { FileItem } from './FileItem';
import { GitStage } from './GitStage';
import { discardAllChanges as _discardAllChanges } from '../widgets/discardAllChanges';
import { discardAllChanges } from '../widgets/discardAllChanges';

export interface IFileListState {
selectedFile: Git.IStatusFile | null;
Expand Down Expand Up @@ -212,7 +212,7 @@ export class FileList extends React.Component<IFileListProps, IFileListState> {
/** Discard changes in all unstaged and staged files */
discardAllChanges = async (event: React.MouseEvent): Promise<void> => {
event.stopPropagation();
await _discardAllChanges(this.props.model, this.props.trans);
await discardAllChanges(this.props.model, this.props.trans);
};

/** Add a specific unstaged file */
Expand Down

0 comments on commit aec26a4

Please sign in to comment.