Add a ReInit function #647

Merged
lollipopman merged 2 commits from reinit into master 2020-09-29 17:42:21 -05:00
lollipopman commented 2020-09-28 16:03:51 -05:00 (Migrated from github.com)

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.
lhchavez (Migrated from github.com) reviewed 2020-09-28 16:36:51 -05:00
lhchavez (Migrated from github.com) commented 2020-09-28 16:36:50 -05:00

oh, interesting use case! Although would something like this work?

	Shutdown()
	init()

if it doesn't, is there any way in which init() can be refactored so that there is less repetition?

oh, interesting use case! Although would something like this work? ```suggestion Shutdown() init() ``` if it doesn't, is there any way in which `init()` can be refactored so that there is less repetition?
lollipopman commented 2020-09-29 13:40:14 -05:00 (Migrated from github.com)

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.

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 commented 2020-09-29 17:41:53 -05:00 (Migrated from github.com)

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!

> 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 (Migrated from github.com) approved these changes 2020-09-29 17:42:01 -05:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: jcarr/git2go#647
No description provided.