fix: return empty strings for branch name and commit hash in error response

ab4d296b229538e6aaae3ce9c41a21e2b451ded5

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +1 -1Showing whitespace changes
src/endpoints/extensions.js+1 -1
@@ -230,7 +230,7 @@ router.post('/version', jsonParser, async (request, response) => {
230 } catch (error) {230 } catch (error) {
231 // it is not a git repo, or has no commits yet, or is a bare repo231 // it is not a git repo, or has no commits yet, or is a bare repo
232 // not possible to update it, most likely can't get the branch name either232 // not possible to update it, most likely can't get the branch name either
233 return response.send({ currentBranchName: null, currentCommitHash, isUpToDate: true, remoteUrl: null });233 return response.send({ currentBranchName: '', currentCommitHash: '', isUpToDate: true, remoteUrl: '' });
234 }234 }
235235
236 const currentBranch = await git.cwd(extensionPath).branch();236 const currentBranch = await git.cwd(extensionPath).branch();