-
Notifications
You must be signed in to change notification settings - Fork 695
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
getStatus hangs #537
Comments
Looks to be a duplicate of: #497 |
D'oh, I tried to search but I guess I was too focused on status/getStatus. For now I'll just use the workaround from #497 of putting |
I'm still seeing this behavior in the latest 0.16 release - |
I'm still seeing this on 0.18.0. The first call to this method in my tests returns, the next one does not return and the .then() is not executed... same for any subsequent calls. It's almost like the first call leaves something in the thread that prevents any others from properly returning the promise |
@heath-guidewire we ended up completely removing use of getStatus from our code, instead diffing the index to working tree using |
Is there an example for this? Basically I want to know whether there have been any changes in the repo from the checked out version so that I can determine that I have to create a commit or not. |
Not sure about examples, but there is a method for it which works well and provides similar results to getStatus with a bit of massaging http://www.nodegit.org/api/diff/#indexToWorkdir Something along the lines of: Git.Diff.indexToWorkdir(repo, null, yourDiffOptions)
.then(diff => {
const changes = {};
for (let i = 0; i < diff.numDeltas(); i++) {
const delta = diff.getDelta(i);
const oldPath = delta.oldFile().path();
const newPath = delta.newFile().path();
const statusPath = oldPath || newPath;
changes[statusPath] = delta.status();
}
return changes;
})
|
Hmm, even that command seems to have the same issue... Sometimes it works and sometimes it doesn't. |
We've not seen any issues with that one (across tens of thousands of commits), I'd definitely check the rest of your code thoroughly, sounds like this might not be where your issue lies - most likely an unreturned promise. |
I'm seeing a weird issue where repository.refreshIndex() does not return: Here's the code I have
I see the 'repo opened' message, but not the 'read index' message. Funny thing is that another method I have that uses refreshIndex() works. I swear I am totally missing something that's causing it to fail. Even using repository.index() seems to not return either. |
I'm trying the status example and finding that if uncommitted changes are present, although the example seems to work (prints
filename MODIFIED
), it doesn't return and I have toctrl+C
. I tried adding.done()
at the end of each promise chain, but nothing gets thrown.This also happens if I remove the details after
getStatus()
, but not if I removegetStatus()
entirely, so this seems to originate in thegetStatus()
call itself. But if the directory is clean, it does return without printing anything.Npm installed
^0.3.3
.Anyone know what's going on here?
The text was updated successfully, but these errors were encountered: