def clone_submodule(repo, fetch_options)
      # the remote was just added by setup_add, no need to check presence
      repo.remotes['origin'].fetch(fetch_options)

      repo.branches.create('master','origin/master')
      repo.branches['master'].upstream = repo.branches['origin/master']

      repo.checkout_head(strategy: :force)
    end
def clone_submodule(repo, fetch_options)
      # the remote was just added by setup_add, no need to check presence
      repo.remotes['origin'].fetch(fetch_options)

      repo.branches.create('master','origin/master')
      repo.branches['master'].upstream = repo.branches['origin/master']

      repo.checkout_head(strategy: :force)
    end
currently libgit2's `git_submodule_add_setup` initializes a repo
 with a workdir for the submodule. libgit2's `git_clone` however
 requires the target for the clone to be an empty dir.

 This provides a ghetto clone implementation that:
 1. fetches the remote
 2. sets up a master branch to be tracking origin/master
 3. checkouts the submodule