-
Notifications
You must be signed in to change notification settings - Fork 33.4k
Add git switch command #114330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add git switch command #114330
Conversation
: localize('select a ref to switch', 'Select a ref to switch')) | ||
: (opts?.detached | ||
? localize('select a ref to checkout detached', 'Select a ref to checkout in detached mode') | ||
: localize('select a ref to checkout', 'Select a ref to checkout')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit-pick: There is a fair bit of string repetition here. Suggested resolution:
const action = opts?.command === 'switch' ? 'switch' : 'checkout';
quickpick.placeholder = opts?.detached
? localize(`select a ref to ${action} detached', 'Select a ref to ${action} in detached mode`)
: localize(`select a ref to ${action}', 'Select a ref to ${action}`));
const force = localize('force', "Force Checkout"); | ||
const stash = localize('stashcheckout', "Stash & Checkout"); | ||
const choice = await window.showWarningMessage(localize('local changes', "Your local changes would be overwritten by checkout."), { modal: true }, force, stash); | ||
const message = opts?.command === 'switch' ? localize('local changes switch', "Your local changes would be overwritten by switch.") : localize('local changes checkout', "Your local changes would be overwritten by checkout."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit-pick: Same suggestion here:
const action = opts?.command === 'switch' ? 'Switch' : 'Checkout';
const message = localize(`local changes ${action}`, "Your local changes would be overwritten by ${action}.`);
const force = localize(`force${action.toLowerCase()}`, `Force ${action.toLowerCase()}``);
const stash = localize(`stash${action}`, `Stash & ${action}`);
const choice = await window.showWarningMessage(localize('local changes', "Your local changes would be overwritten by checkout."), { modal: true }, force, stash); | ||
const message = opts?.command === 'switch' ? localize('local changes switch', "Your local changes would be overwritten by switch.") : localize('local changes checkout', "Your local changes would be overwritten by checkout."); | ||
const force = opts?.command === 'switch' ? localize('forceswitch', "Force Switch") : localize('forcecheckout', "Force Checkout"); | ||
const stash = opts?.command === 'switch' ? localize('stashswitch', "Stash & Switch") : localize('stashcheckout', "Stash & Checkout"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit-pick: The difference use of single and double quotes on the above to line (BTW: I am not sure on what the project coding standard / linting enforces here)
This PR fixes #114066