Does not checkout the afterCommit in the cloned repo#9
Does not checkout the afterCommit in the cloned repo#9octomike wants to merge 3 commits intoGlavin001:masterfrom
afterCommit in the cloned repo#9Conversation
Without this addition we are only seeing master checked out. Are we doing it wrong is was that bug?
|
It uses the after commit from the webhook payload from GitLab, and then checks out that commit at https://github.com/Glavin001/GitLab-Pages/blob/master/routes/webhooks.js#L57 tl;drSo really it does not even checkout the branch, it checks out the commit that was most recently pushed, and only if that commit lies within that I'll take a look later this week when I get a chance and see if it's a true bug. Could you detail some steps I could use to reproduce? For instance, enable repo for GitLab Pages, set |
|
Thanks for the explanation! |
|
Yes, it should be checking that commit out in the clone, which is in the tmp directory. Could you:
|
Manually checking it out in .tmp/ works fine. How do I debug that repo.getCommit(afterCommit)[https://github.com/Glavin001/GitLab-Pages/blob/master/routes/webhooks.js#L57] call further? |
|
It looks like a NodeGit bug. I've found others, too. See nodegit/nodegit#341 (comment) They recommend that you discuss with them on their Gitter channel. Let me know if you're able to resolve this and we can fix this for everyone. Thanks! |
afterCommit in the cloned repo
|
As suspected. Hi @octomike! getCommit(sha) simply returns information about a commit in the repo, it doesn’t affect he working directory. ( https://gitter.im/nodegit/nodegit ) |
|
Well, that explains a lot.. haha. Thanks for looking into that! |
|
Use Thanks to @orderedlist |
|
Meh, the updated pull request doesn't work. Ignore that please :) |
|
Does it not checkout the commit still? Bummer. If it's not that then what NodeGit API call? |
+ use checkoutBranch when cloning for now
|
Tested, works fine. Once they actually implemented what's in the API, you can use the line in the comment. 😸 |
|
So |
|
Yes, I just asked in their gitter channel. |
|
Wow, it's unfortunate that NodeGit is so unusable in it's current state. I may even investigate using |
|
Probably because js-git has become so popular! This is a node wrapper for it. |
|
Great! Then it looks like switching to use jsgit is a good idea. |
|
I think git checkout tree is implemented now! |
Fixes #9. Upgrade dependencies, especially Nodegit
|
I recommend updating GitLab Pages and this should now work. Let me know if there are any other problems. Thanks! |
Without this addition we are only seeing master checked out.
Are we doing it wrong or was that bug?