Skip to content

Commit

Permalink
set gitUserName to NULL even if specified
Browse files Browse the repository at this point in the history
  • Loading branch information
eliotmcintire committed Nov 6, 2024
1 parent 51ebde9 commit da63cb3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions R/setupProject.R
Original file line number Diff line number Diff line change
Expand Up @@ -2588,7 +2588,6 @@ setupRestart <- function(updateRprofile, paths, name, inProject,

}


if (!rprojroot::is_rstudio_project$testfun[[1]](pp)) {
host <- "https://github.com"
tf <- tempfile2();
Expand Down Expand Up @@ -2649,7 +2648,11 @@ setupRestart <- function(updateRprofile, paths, name, inProject,
}
if (!(exists("gitUserNamePoss", inherits = FALSE)))
gitUserNamePoss <- gh::gh_whoami()$login
if (identical(gitUserName, gitUserNamePoss))

gitconf <- gert::git_config()
un2 <- gitconf$value[gitconf$name %in% "user.name"]

if (identical(gitUserName, gitUserNamePoss) || identical(un2, gitUserName) )
gitUserName <- NULL

githubRepoExists <- usethis::use_github(gitUserName) # This will fail if not an organization
Expand Down

0 comments on commit da63cb3

Please sign in to comment.