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

[bug] git.fetch_commit() throws an error when downloading sources to subfolder #17295

Open
bkarasm opened this issue Nov 8, 2024 · 2 comments
Assignees
Milestone

Comments

@bkarasm
Copy link

bkarasm commented Nov 8, 2024

Describe the bug

conan.tools.scm.Git.fetch_commit() method throws an error when folder argument is passed to Git class constructor:

def source(self):
    git = Git(self, folder="myFolder")
    git.fetch_commit(url, commit=self.conan_data["sources"]["commit"])

Error message:

ERROR: mypackage/1.2.3: Error in source() method, line 65
        git.fetch_commit(url, commit=self.conan_data["sources"]["commit"])
        FileNotFoundError: [Errno 2] No such file or directory: 'myFolder'

It seems that mkdir(self.folder) is missing in the body of fetch_commit() method - similarly as it is done in clone() method.

How to reproduce it

No response

@memsharded memsharded self-assigned this Nov 9, 2024
@memsharded
Copy link
Member

Hi @bkarasm

Thanks for your report.
It seems it could be a small UX improvement (what we call a fix, not a bugfix), and I think it should be very straightforward, would you like to do it yourself and contribute a PR?

@memsharded memsharded added this to the 2.10.0 milestone Nov 9, 2024
@bkarasm
Copy link
Author

bkarasm commented Nov 13, 2024

Sure, I can give it a try.

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

No branches or pull requests

2 participants