-
Notifications
You must be signed in to change notification settings - Fork 910
Clone recursively #640
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
Clone recursively #640
Conversation
LibGit2Sharp/Core/NativeMethods.cs
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sometimes, native methods specify ref
here for no apparent reason. Is it required here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Usually this is used when the native signature uses a git_oid*
. GitOid
is a struct on the managed side, so to get a "pointer" to it, you use ref
.
Pretty sure that's how it works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I see, most arguments to native methods use reference types. Curiously enough, it still works without ref
.
hm, travis did not find the new repository. Do I have to add new resources somewhere? |
What should we do if the init/update fails? I'd say, revert everything, i.e. delete the directory of the main repo. Should we expose |
LibGit2Sharp/Submodule.cs
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know whether it is intended, but git_repository_init_ext
adds a .git
to the gitdirPath
. It will still work, but it would be better if the repo was in .git/modules/name
instead of .git/modules/name/.git/
. Do you know how to achieve that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you can add the GIT_REPOSITORY_INIT_NO_DOTGIT_DIR
flag to achieve this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Yeah, you'll have to add your new test repo to the LibGit2Sharp.Tests/Resources directory. |
Thanks for your feedback, @ben!
I did, and it works locally, but travis says
Maybe that's a linux-specific problem, I can only test on Windows. |
It's not anything about Linux, it's just that what you have locally is not what's in the history. The If you clone your repo locally, you should see the same error as on travis. |
@carlosmn Ah, thanks! That fixed it. The build still fails because of |
Added CloneOptions.Recursive to specify whether submodules should be initialized and updated after checkout
Superseded by #949 Cheers! |
This implements
git clone --recursive
by performing the following steps:This is a work in progress.