Skip to content
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

Positron doesn't need restart for git pane #2011

Merged
merged 2 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# usethis (development version)

* `use_git()` no longer asks if you want to restart RStudio when using Positron.

* `use_test()` and `use_r()` now work when you are in `tests/testthat/_snaps/{foo}.md` (@olivroy, #1988).

* The URLs baked into the badge generated by `use_coverage(type = "codecov")`
Expand Down
2 changes: 1 addition & 1 deletion R/git.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use_git <- function(message = "Initial commit") {
git_ask_commit(message, untracked = TRUE)
}

if (needs_init) {
if (needs_init && !is_positron()) {
restart_rstudio("A restart of RStudio is required to activate the Git pane.")
}

Expand Down
3 changes: 3 additions & 0 deletions R/positron.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
is_positron <- function() {
Sys.getenv("POSITRON") == "1"
}
Loading