-
Notifications
You must be signed in to change notification settings - Fork 55
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
Remove ./ when getting file in GitLab #844
Conversation
Build succeeded. ✔️ pre-commit SUCCESS in 2m 37s |
@@ -361,6 +362,8 @@ def get_branches(self) -> list[str]: | |||
|
|||
def get_file_content(self, path, ref=None) -> str: | |||
ref = ref or self.default_branch | |||
# GitLab cannot resolve './' | |||
path = os.path.normpath(path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was looking for this function, but everything I managed to find on the Path
class was impure /o And this (at least documentation doesn't say a thing) is pure, but under the os
module /o\ This language is a mess…
Build failed. ❌ pre-commit FAILURE in 2m 35s |
So that the behaviour is consistent among forges. GitLab cannot do this automatically. Related to packit#838
Build succeeded. ✔️ pre-commit SUCCESS in 2m 35s |
regate |
Build succeeded (gate pipeline). ✔️ pre-commit SUCCESS in 2m 31s |
50b02cb
into
packit:main
So that the behaviour is consistent among forges. GitLab cannot do this automatically (confirmed that both GitHub and Pagure can).
Related to #838
RELEASE NOTES BEGIN
GitLabProject.get_file_content
can now correctly handle file paths starting with./
.RELEASE NOTES END