Force system git in install_git() to avoid failures when git2r is installed (#832)#841
Closed
tanmaydimriGSOC wants to merge 2 commits intor-lib:mainfrom
Closed
Force system git in install_git() to avoid failures when git2r is installed (#832)#841tanmaydimriGSOC wants to merge 2 commits intor-lib:mainfrom
tanmaydimriGSOC wants to merge 2 commits intor-lib:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes issue #832, where
remotes::install_git()fails when thegit2rpackage is installed. The failure occurs because the defaultbackend selection (
git = c("auto", "git2r", "external")) allowsinstall_git()to choosegit2r, which cannot clone certain Git reposand results in an error.
What this PR does
This PR forces the use of the system git backend inside
install_git()by adding:
inside the function. This ensures that git2r is not selected as the
backend when cloning repositories.
Why this change is minimal and safe
install_git().Testing
After applying the patch, I tested:
install.packages("git2r")remotes::install_git("https://github.com/r-lib/remotes")The installation succeeded without errors. Previously, installing from
Git with git2r installed produced the reported failure.
Additional notes
This patch is intentionally small and localized, following the
maintainers' preference for minimal-diff fixes. If preferred, I can also
extend the fix by modifying backend selection logic in
git_backend(),but this PR implements the simplest solution to restore correct
behavior.
Fixes #832.