From b8435105e3d5e365d0c576b78c0a5ffd50ccb139 Mon Sep 17 00:00:00 2001 From: tanmaydimriGSOC Date: Sun, 30 Nov 2025 23:51:31 +0530 Subject: [PATCH 1/2] Fix install_git() failure when git2r is installed by forcing system git (#832) --- R/install-git.R | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/R/install-git.R b/R/install-git.R index 10170b0b..876cc849 100644 --- a/R/install-git.R +++ b/R/install-git.R @@ -41,11 +41,19 @@ install_git <- function(url, subdir = NULL, ref = NULL, branch = NULL, repos = getOption("repos"), type = getOption("pkgType"), ...) { + + # ------------------------------------------ + # PATCH: Force system git, avoid git2r crash + # ------------------------------------------ + git <- "external" + # ------------------------------------------ + if (!missing(branch)) { warning("`branch` is deprecated, please use `ref`") ref <- branch } + remotes <- lapply(url, git_remote, subdir = subdir, ref = ref, credentials = credentials, git = match.arg(git) From e7dea93ea8c6523a56b51579f3358c74e0e37060 Mon Sep 17 00:00:00 2001 From: tanmaydimriGSOC Date: Mon, 1 Dec 2025 00:19:41 +0530 Subject: [PATCH 2/2] Refine backend selection: prefer system git when auto and git2r present (#832) --- R/install-git.R | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/R/install-git.R b/R/install-git.R index 876cc849..d60fb684 100644 --- a/R/install-git.R +++ b/R/install-git.R @@ -42,11 +42,13 @@ install_git <- function(url, subdir = NULL, ref = NULL, branch = NULL, type = getOption("pkgType"), ...) { - # ------------------------------------------ + # PATCH: Force system git, avoid git2r crash - # ------------------------------------------ - git <- "external" - # ------------------------------------------ + + if ("git2r" %in% git && git[1] == "auto") { + git[1] <- "external" + } + if (!missing(branch)) { warning("`branch` is deprecated, please use `ref`")