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

Fix GetFile support for GitHub getter #355

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

arikkfir
Copy link

@arikkfir arikkfir commented Apr 11, 2022

This change fixes support for getting single files from GitHub.

While this worked fine for other Git repositories, it did not work for GitHub, because the getter tried to clone a wrong URL. For example, if a GitHub URL of "https://github.com/owner/repo/subdir/file.txt" would be given to "GetFile", it would clone "https://github.com/owner/repo/subdir" instead of cloning "https://github.com/owner/repo" and extracting "subdir/file.txt".

Test attached.

This fixes #98

@hashicorp-cla
Copy link

hashicorp-cla commented Apr 11, 2022

CLA assistant check
All committers have signed the CLA.

@arikkfir
Copy link
Author

arikkfir commented Aug 3, 2022

Rebased branch to include new commits since April 2022 - and the change is still relevant and needed.

This change fixes support for getting single files from GitHub.

While this worked fine for other Git repositories, it did not work for GitHub, because the getter tried to clone a wrong URL. For example, if a GitHub URL of "https://github.com/owner/repo/subdir/file.txt" would be given to "GetFile", it would clone "https://github.com/owner/repo/subdir" instead of cloning "https://github.com/owner/repo" and extracting "subdir/file.txt".
@arikkfir arikkfir force-pushed the support_getfile_from_github branch from ec90c7c to 281b767 Compare August 3, 2022 16:46
@arikkfir
Copy link
Author

arikkfir commented Aug 3, 2022

Rebased this branch off of the v1.6.2 tag, so that it can be fully compatible with the v1.6.2 release (with the addition of this fix).

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.

Retrieving a single file from a git repo?
2 participants