Skip to content
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

Fixed a bug which caused that creating a branch didn't work anymore. #6071

Merged
merged 2 commits into from
Aug 30, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/git/src/browser/git-quick-open-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ export class GitQuickOpenService {
};
const items: QuickOpenItem[] = branches.map(branch => new GitQuickOpenItem(branch, this.wrapWithProgress(switchBranch), toLabel, toDescription));
const createBranchItem = async (item: QuickOpenItem) => {
const { git, gitErrorHandler, wrapWithProgress } = this;
const { git, gitErrorHandler, doWrapWithProgress } = this;
const createBranchModel: QuickOpenModel = {
onType(lookFor: string, acceptor: (items: QuickOpenItem[]) => void): void {
const dynamicItems: QuickOpenItem[] = [];
Expand All @@ -284,7 +284,7 @@ export class GitQuickOpenService {
} else {
dynamicItems.push(new SingleStringInputOpenItem(
`Create a new local branch with name: ${lookFor}. ${suffix}`,
wrapWithProgress(async () => {
doWrapWithProgress(async () => {
try {
await git.branch(repository, { toCreate: lookFor });
await git.checkout(repository, { branch: lookFor });
Expand Down Expand Up @@ -590,6 +590,7 @@ export class GitQuickOpenService {
return this.progressService.withProgress('', 'scm', fn);
}

protected readonly doWrapWithProgress = (fn: (...args: []) => Promise<void>) => this.wrapWithProgress(fn);
jbicker marked this conversation as resolved.
Show resolved Hide resolved
protected wrapWithProgress<In, Out>(fn: (...args: In[]) => Promise<Out>): (...args: In[]) => Promise<Out> {
return (...args: In[]) => this.withProgress(() => fn(...args));
}
Expand Down