Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add SubmoduleCollection.Add #1501

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

JasonGoemaat
Copy link

Added SubmoduleCollection.Add(url, path, useGitLink).

Looking for some input here if this can be done a better way. The docs say call git_submodule_add_setup(), then clone the repo or whatever, then call git_submodule_add_finalize() to add the submodule and '.gitmodules' to the index.

I wasn't sure how to create a Submodule without a name, or is that just the path? It seems like cloning the repository into the desired directory first and then calling both setup and finalize methods works fine and is how it is actually done when creating a new submodule, isn't it?

@JasonGoemaat JasonGoemaat force-pushed the feature/submodule-add branch from 9f1bb67 to 9c43f85 Compare November 9, 2017 23:57
@jminer
Copy link

jminer commented Jan 10, 2020

I need this functionality too. What needs to be done to get this added? I can probably work on it some if needed. I saw in a past PR a review comment that this code should be in Commands.SubmoduleAdd. Is that still true? Is there anything else?

JohnathanFL added a commit to JohnathanFL/libgit2sharp-submodules that referenced this pull request Mar 12, 2023
Credit to libgit2#1501 / JasonGoemaat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants