Skip to content

Commit

Permalink
Register symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
stewid committed Oct 17, 2024
1 parent 44ecfca commit c72cd7d
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 6 deletions.
1 change: 1 addition & 0 deletions R/blob.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
##' is TRUE.
##' @return list of S3 class git_blob \code{objects}
##' @export
##' @useDynLib git2r git2r_blob_create_fromdisk
##' @useDynLib git2r git2r_blob_create_fromworkdir
##' @examples
##' \dontrun{
Expand Down
13 changes: 12 additions & 1 deletion R/checkout.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## git2r, R bindings to the libgit2 library.
## Copyright (C) 2013-2019 The git2r contributors
## Copyright (C) 2013-2024 The git2r contributors
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License, version 2,
Expand Down Expand Up @@ -41,17 +41,26 @@ previous_branch_name <- function(repo) {
branch
}

##' @useDynLib git2r git2r_checkout_tree
##' @useDynLib git2r git2r_repository_set_head
##' @noRd
checkout_branch <- function(object, force) {
ref_name <- paste0("refs/heads/", object$name)
.Call(git2r_checkout_tree, object$repo, ref_name, force)
.Call(git2r_repository_set_head, object$repo, ref_name)
}

##' @useDynLib git2r git2r_checkout_tree
##' @useDynLib git2r git2r_repository_set_head_detached
##' @noRd
checkout_commit <- function(object, force) {
.Call(git2r_checkout_tree, object$repo, object$sha, force)
.Call(git2r_repository_set_head_detached, object)
}

##' @useDynLib git2r git2r_checkout_tree
##' @useDynLib git2r git2r_repository_set_head_detached
##' @noRd
checkout_tag <- function(object, force) {
.Call(git2r_checkout_tree, object$repo, object$target, force)
.Call(git2r_repository_set_head_detached,
Expand Down Expand Up @@ -101,6 +110,8 @@ checkout_git_object <- function(object, force) {
##' @param ... Additional arguments. Not used.
##' @return invisible NULL
##' @export
##' @useDynLib git2r git2r_checkout_path
##' @useDynLib git2r git2r_repository_set_head
##' @examples
##' \dontrun{
##' ## Create directories and initialize repositories
Expand Down
3 changes: 2 additions & 1 deletion R/contributions.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## git2r, R bindings to the libgit2 library.
## Copyright (C) 2013-2019 The git2r contributors
## Copyright (C) 2013-2024 The git2r contributors
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License, version 2,
Expand All @@ -23,6 +23,7 @@
##' @param by Contributions by "commits" or "author". Default is "commits".
##' @return A \code{data.frame} with contributions.
##' @export
##' @useDynLib git2r git2r_revwalk_contributions
##' @examples
##' \dontrun{
##' ## Create directories and initialize repositories
Expand Down
4 changes: 3 additions & 1 deletion R/odb.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## git2r, R bindings to the libgit2 library.
## Copyright (C) 2013-2018 The git2r contributors
## Copyright (C) 2013-2024 The git2r contributors
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License, version 2,
Expand Down Expand Up @@ -32,6 +32,7 @@
##' }
##' @note A blob sha can have several entries
##' @export
##' @useDynLib git2r git2r_odb_blobs
##' @examples \dontrun{
##' ## Create a directory in tempdir
##' path <- tempfile(pattern="git2r-")
Expand Down Expand Up @@ -86,6 +87,7 @@ odb_blobs <- function(repo = ".") {
##' \item{len}{The length of the object}
##' }
##' @export
##' @useDynLib git2r git2r_odb_objects
##' @examples \dontrun{
##' ## Create a directory in tempdir
##' path <- tempfile(pattern="git2r-")
Expand Down
5 changes: 4 additions & 1 deletion R/reset.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## git2r, R bindings to the libgit2 library.
## Copyright (C) 2013-2019 The git2r contributors
## Copyright (C) 2013-2024 The git2r contributors
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License, version 2,
Expand Down Expand Up @@ -35,6 +35,9 @@
##' entries for all paths to their state at HEAD.
##' @return invisible NULL
##' @export
##' @useDynLib git2r git2r_index_remove_bypath
##' @useDynLib git2r git2r_reset
##' @useDynLib git2r git2r_reset_default
##' @examples \dontrun{
##' ## Initialize a temporary repository
##' path <- tempfile(pattern="git2r-")
Expand Down
3 changes: 2 additions & 1 deletion R/revparse.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## git2r, R bindings to the libgit2 library.
## Copyright (C) 2013-2018 The git2r contributors
## Copyright (C) 2013-2024 The git2r contributors
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License, version 2,
Expand All @@ -23,6 +23,7 @@
##' @return a \code{git_commit} or \code{git_tag} or \code{git_tree}
##' object
##' @export
##' @useDynLib git2r git2r_revparse_single
##' @examples
##' \dontrun{
##' ## Create a directory in tempdir
Expand Down
3 changes: 2 additions & 1 deletion R/status.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## git2r, R bindings to the libgit2 library.
## Copyright (C) 2013-2019 The git2r contributors
## Copyright (C) 2013-2024 The git2r contributors
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License, version 2,
Expand Down Expand Up @@ -28,6 +28,7 @@
##' directories if \code{untracked} is \code{TRUE}.
##' @return \code{git_status} with repository status
##' @export
##' @useDynLib git2r git2r_status_list
##' @examples
##' \dontrun{
##' ## Initialize a repository
Expand Down

0 comments on commit c72cd7d

Please sign in to comment.