Skip to content

Add a ReInit function #647

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

Merged
merged 2 commits into from
Sep 29, 2020
Merged

Add a ReInit function #647

merged 2 commits into from
Sep 29, 2020

Conversation

lollipopman
Copy link
Contributor

libgit2 stores the lookup paths for gitconfig files in its global state.
This means that after a program changes its effective uid libgit2 will
still look for gitconfig files in the home directory of the original
uid. Expose a way to call C.git_libgit2_init so a user can reinitialize
the libgit2 global state.

libgit2 stores the lookup paths for gitconfig files in its global state.
This means that after a program changes its effective uid libgit2 will
still look for gitconfig files in the home directory of the original
uid. Expose a way to call C.git_libgit2_init so a user can reinitialize
the libgit2 global state.
Go does not allow you to call the package init() function, so instead
add a new function to initialize libgit2 and use that function to reduce
the repetition in ReInit()
@lollipopman
Copy link
Contributor Author

thanks @lhchavez for taking a look, I pushed a commit to reduce the repetition, which seems to work fine, though I am not super happy with the function naming.

@lhchavez
Copy link
Contributor

thanks @lhchavez for taking a look, I pushed a commit to reduce the repetition, which seems to work fine, though I am not super happy with the function naming.

That name is fine. Since it's a private function, if you ever come up with a better alternative, we can change it without fear of breaking anything!

@lhchavez lhchavez merged commit 3c5c580 into libgit2:master Sep 29, 2020
github-actions bot pushed a commit that referenced this pull request Sep 29, 2020
libgit2 stores the lookup paths for gitconfig files in its global state.
This means that after a program changes its effective uid libgit2 will
still look for gitconfig files in the home directory of the original
uid. Expose a way to call C.git_libgit2_init so a user can reinitialize
the libgit2 global state.

(cherry picked from commit 3c5c580)
github-actions bot pushed a commit that referenced this pull request Sep 29, 2020
libgit2 stores the lookup paths for gitconfig files in its global state.
This means that after a program changes its effective uid libgit2 will
still look for gitconfig files in the home directory of the original
uid. Expose a way to call C.git_libgit2_init so a user can reinitialize
the libgit2 global state.

(cherry picked from commit 3c5c580)
lhchavez pushed a commit that referenced this pull request Sep 29, 2020
libgit2 stores the lookup paths for gitconfig files in its global state.
This means that after a program changes its effective uid libgit2 will
still look for gitconfig files in the home directory of the original
uid. Expose a way to call C.git_libgit2_init so a user can reinitialize
the libgit2 global state.

(cherry picked from commit 3c5c580)

Co-authored-by: Jesse Hathaway <jesse@mbuki-mvuki.org>
lhchavez pushed a commit that referenced this pull request Sep 29, 2020
libgit2 stores the lookup paths for gitconfig files in its global state.
This means that after a program changes its effective uid libgit2 will
still look for gitconfig files in the home directory of the original
uid. Expose a way to call C.git_libgit2_init so a user can reinitialize
the libgit2 global state.

(cherry picked from commit 3c5c580)

Co-authored-by: Jesse Hathaway <jesse@mbuki-mvuki.org>
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.

2 participants