From b810db6190ca5884483d5b29f969b6534c653061 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Thu, 18 Jan 2024 11:40:00 -0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20index=20even=20in=20non-git=20di?= =?UTF-8?q?rectories?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extensions/vscode/src/continueIdeClient.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/extensions/vscode/src/continueIdeClient.ts b/extensions/vscode/src/continueIdeClient.ts index 87a0ec33d..650665aff 100644 --- a/extensions/vscode/src/continueIdeClient.ts +++ b/extensions/vscode/src/continueIdeClient.ts @@ -447,7 +447,7 @@ class IdeProtocolClient { while (!repo?.state?.HEAD?.name) { await new Promise((resolve) => setTimeout(resolve, 1000)); i++; - if (i >= 30) { + if (i >= 20) { return undefined; } repo = await this._getRepo(forDirectory); @@ -458,10 +458,14 @@ class IdeProtocolClient { async getBranch(forDirectory: vscode.Uri) { let repo = await this.getRepo(forDirectory); if (repo?.state?.HEAD?.name === undefined) { - const { stdout } = await exec("git rev-parse --abbrev-ref HEAD", { - cwd: forDirectory.fsPath, - }); - return stdout?.trim() || "NONE"; + try { + const { stdout } = await exec("git rev-parse --abbrev-ref HEAD", { + cwd: forDirectory.fsPath, + }); + return stdout?.trim() || "NONE"; + } catch (e) { + return "NONE"; + } } return repo?.state?.HEAD?.name || "NONE";