Skip to content

Commit

Permalink
Fixed a bug which caused that creating a branch didn't work anymore.
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Bicker <jan.bicker@typefox.io>
  • Loading branch information
jbicker committed Aug 30, 2019
1 parent b0d8292 commit 27d3cff
Showing 1 changed file with 3 additions and 2 deletions.
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);
protected wrapWithProgress<In, Out>(fn: (...args: In[]) => Promise<Out>): (...args: In[]) => Promise<Out> {
return (...args: In[]) => this.withProgress(() => fn(...args));
}
Expand Down

0 comments on commit 27d3cff

Please sign in to comment.