Closed LiyouZhou closed 6 years ago
Argh, anybody know how to debug test failures?
You can run specs locally using atom --test spec
or by executing the "Window: Run Package Specs" command from within Atom.
Hi, any news on this ? I'm currently in a project with this problem and this is kind of annoying... Thank you in advance !
lol, last update was from a year and half ago. I have forgot all the coffee script that I have learnt to fix this bug. It seems the atom team is not great at accepting contributions from the outside. maybe it would be better if you filed an issue instead and let the atom team fix it.
We're going to see if we can solve this at a broader level via atom/atom#2203. Thanks @LiyouZhou for the work you did here and our apologies for not handling this better.
use atom API
repositoryForDirectory
to get git repo associated with any open file. Replaces the old behaviour where it is assumed that the git repo is at top level of the project.Requirements
Description of the Change
git-diff uses helper function
repositoryForPath
to get back a gitRepository object for each editor view.The old implementation of
repositoryForPath
uses thegetRepositories()
API. Which only gives you repositories associated with project's directories. This means the git repo must exist in the projects's top level in order for it to be recognised.However, there are situations where the git repo associated with a file under edit may not reside in the project's top level. For situations like the following:
If you opened
file_under_version_control.c
, git-diff does not work.The new implementation uses the new atom API repositoryForDirectory. The new API returns a promise and fulfils it asynchronously. Which means the caller of
repositoryForPath
need to be modified as well.Alternate Designs
NA
Benefits
Enable usecases where the git repo is not at top level of project. Allow git-dff to be useful in more usecases. New API uses asynchronous API which allow UI to be more responsive. As
getRepositories()
is being deprecated in atom 2, this change allow the transition to happen.Possible Drawbacks
NA
Applicable Issues
NA