Skip to content
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

porcelain pull has trouble with submodules #505

Closed
roeles opened this issue Mar 1, 2017 · 2 comments
Closed

porcelain pull has trouble with submodules #505

roeles opened this issue Mar 1, 2017 · 2 comments
Labels

Comments

@roeles
Copy link

roeles commented Mar 1, 2017

I'm using dulwich to auto-update a piece of python.

After performing this command:
git clone --recursive https://github.com/germandutchwindtunnels/nettools.git

I perform:

cd nettools; 
python AutoUpdate.py NewGui.pyw <user> <pass> <switch>

In AutoUpdate.py I utilize porcelain like so:

import dulwich.porcelain as porcelain #pylint: disable=import-error
import dulwich.errors #pylint: disable=import-error
...
github_url = "https://github.com/germandutchwindtunnels/nettools.git"
target_dir = "./"
...
try:
	porcelain.pull(target_dir, github_url)
except dulwich.errors.NotGitRepository:
	porcelain.clone(github_url, target_dir)

This yields an error regarding dulwich as a submodule:

Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
Traceback (most recent call last):
  File "AutoUpdate.py", line 34, in <module>
    porcelain.pull(target_dir, github_url)
  File "./dulwich/dulwich/porcelain.py", line 723, in pull
    r.reset_index()
  File "./dulwich/dulwich/repo.py", line 938, in reset_index
    validate_path_element=validate_path_element)
  File "./dulwich/dulwich/index.py", line 513, in build_index_from_tree
    os.mkdir(full_path)
OSError: [Errno 17] File exists: './dulwich'

I'd like to be able to tell porcelain.pull that the existing directory is not an issue.

@jelmer
Copy link
Owner

jelmer commented Mar 1, 2017 via email

@jelmer jelmer closed this as completed in fb60cac Mar 1, 2017
@jelmer
Copy link
Owner

jelmer commented Mar 1, 2017

This very specific issue has been fixed. Support for recursively cloning/pulling a repo with submodules is a different topic. I've filed #506 about that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants