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

Force pygit2 global search path to be set to HOME environment variable. #10321

Merged
merged 4 commits into from Jan 8, 2019

Conversation

EnTeQuAk
Copy link
Contributor

@EnTeQuAk EnTeQuAk commented Jan 7, 2019

It's a bit problematic since there isn't a real good default value since
it depends on how the app is hosted, if HOME is set correctly and many
other circumstances. Let's enforce it to be the users home to make sure
we are accessing a directory that we have the permissions to.

Fixes #10320

It's a bit problematic since there isn't a real good default value since
it depends on how the app is hosted, if `HOME` is set correctly and many
other circumstances. Let's enforce it to be the users home to make sure
we are accessing a directory that we have the permissions to.

Fixes #10320
@EnTeQuAk EnTeQuAk requested a review from diox January 7, 2019 11:35
@@ -38,6 +39,24 @@ def test_temporary_worktree():
assert worktree.name not in output


def test_enforce_pygit_global_search_path_to_home():
# https://github.com/mozilla/addons-server/issues/10320
pygit2.settings.search_path[pygit2.GIT_CONFIG_LEVEL_GLOBAL] = '/root'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't you revert this to the original value ? And also make sure that it is indeed reverted, regardless of whether the test succeeds or not ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indeed, I'll fix that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 9b2d5a5

@EnTeQuAk EnTeQuAk requested a review from diox January 8, 2019 05:01
@EnTeQuAk EnTeQuAk merged commit dae0f9f into master Jan 8, 2019
@EnTeQuAk EnTeQuAk deleted the 10320-force-git-homepath-set-user-home branch January 8, 2019 16:26
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.

None yet

2 participants