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

Fix bug that caused repositories to not be found #7870

Merged
merged 1 commit into from
May 25, 2020
Merged

Conversation

westbury
Copy link
Contributor

fixes #7860

What it does

When upgrading to Typescript 3.9.1-rc, a line of code was detected as being in error and corrected appropriately. A test on stat.isDirectory was corrected to stat.isDirectory(). However this actually introduced a problem because the code was no longer being called for files. Most of the code should not have been called for files, though it was harmless to do so because findGitRepositories returned an empty array and the rest of the code operated on empty arrays. However the final resolve to [] was needed. Failure to resolve the promise when a file ultimately broke the repository locator.

A simple fix would have been to resolve when a file. However it is not necessary to wrap this in a Promise so I removed that. If there is some reason the Promise wrapper is wanted then we can leave that, but be sure to resolve it also in the inner error handler.

How to test

Check that all expected Git repositories are found. Check various situations (changing workspaces, adding and removing repositories, nested repositories, error conditions etc).

Review checklist

Reminder for reviewers

Signed-off-by: Nigel Westbury <nigelipse@miegel.org>
@westbury westbury added the git issues related to git label May 23, 2020
@502647092
Copy link
Contributor

@westbury Looks like it's fixed
image

Copy link
Member

@akosyakov akosyakov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you for fixing it!

@akosyakov akosyakov merged commit ef77343 into master May 25, 2020
@akosyakov akosyakov deleted the fix-locate-repos branch May 25, 2020 06:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
git issues related to git
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[git-scm] No repository found
3 participants