Skip to content

Clone Recursively #639

@Yogu

Description

@Yogu

I'd like to implement git clone --recursive. As I understand, this is possible with libgit2#1855. However, there is still work to be done in libgit2sharp.

  • Clone repository normally
  • For each submodule
    • Init repository with git_repository_init_ext to explicitly specify workdir and .git dir
    • Create the symbolic link to .git in the workdir path
    • git_clone_into, specifying the commit sha as branch argument
    • For each submodule... (recursively)

Did I miss something? I have a few questions

  • What is the best way to create the symbolic link .git platform-independently? It should be a simple text file in Windows, but a real symbolic link in unix.
  • Can I specify a commit sha as branch argument for git_clone_into?
  • What to do if something fails? I think it would be best to roll back everything, so just delete the whole directory?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions