Skip to content

Commit 98c8466

Browse files
committed
like so @jeroen?
1 parent 1cc5ee0 commit 98c8466

2 files changed

Lines changed: 12 additions & 9 deletions

File tree

R/commit.R

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ git_stat_files <- function(files, ref = "HEAD", max = NULL, repo = '.') {
254254
#' @family git
255255
#' @inheritParams git_open
256256
#' @inheritParams git_commit
257+
#' @inheritParams git_commit_info
257258
#' @param commit a commit reference (SHA, branch name, or revision expression
258259
#' such as `HEAD~1`) identifying the commit to revert. Must be an ancestor of
259260
#' the current HEAD.
@@ -301,22 +302,22 @@ git_stat_files <- function(files, ref = "HEAD", max = NULL, repo = '.') {
301302
#' unlink(repo, recursive = TRUE)
302303
#' @useDynLib gert R_git_revert
303304
git_revert <- function(
304-
commit,
305+
ref,
305306
message = NULL,
306307
author = NULL,
307308
committer = NULL,
308309
no_commit = FALSE,
309310
repo = '.'
310311
) {
311312
repo <- git_open(repo)
312-
assert_string(commit)
313+
assert_string(ref)
313314
stopifnot(is.logical(no_commit), length(no_commit) == 1)
314315

315-
sha <- try(git_commit_id(commit, repo = repo), silent = TRUE)
316+
sha <- try(git_commit_id(ref, repo = repo), silent = TRUE)
316317
if (inherits(sha, "try-error")) {
317318
stop(sprintf(
318-
"Can't find commit '%s' in the current branch history",
319-
commit
319+
"Can't find reference/commit '%s' in the current branch history",
320+
ref
320321
))
321322
}
322323

man/git_revert.Rd

Lines changed: 6 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)