You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 to ctrl+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 remove getStatus() entirely, so this seems to originate in the getStatus() call itself. But if the directory is clean, it does return without printing anything.
I'm still seeing this behavior in the latest 0.16 release - getStatus does not resolve sporadically - trying to dig into what might be causing this for us :(
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 NodeGit.Diff. Maybe that's a strategy you could take…
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.
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 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.
Activity
tbranyen commentedon Apr 11, 2015
Looks to be a duplicate of: #497
AdamStone commentedon Apr 11, 2015
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
process.exit()in the.done()method.tommoor commentedon Dec 7, 2016
I'm still seeing this behavior in the latest 0.16 release -
getStatusdoes not resolve sporadically - trying to dig into what might be causing this for us :(heath-guidewire commentedon Apr 6, 2017
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
tommoor commentedon Apr 6, 2017
@heath-guidewire we ended up completely removing use of getStatus from our code, instead diffing the index to working tree using
NodeGit.Diff. Maybe that's a strategy you could take…heath-guidewire commentedon Apr 6, 2017
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.
tommoor commentedon Apr 6, 2017
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:
heath-guidewire commentedon Apr 6, 2017
Hmm, even that command seems to have the same issue... Sometimes it works and sometimes it doesn't.
tommoor commentedon Apr 6, 2017
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.
heath-guidewire commentedon Apr 6, 2017
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.