Skip to content

Commit

Permalink
Refactoring of 'default_signature' function
Browse files Browse the repository at this point in the history
  • Loading branch information
stewid committed Jan 7, 2018
1 parent 2cc636d commit 61a7bd7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 26 deletions.
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export(clone)
export(config)
export(cred_ssh_key)
export(cred_token)
export(default_signature)
export(in_repository)
export(is_bare)
export(is_blob)
Expand Down Expand Up @@ -73,7 +74,6 @@ exportMethods(content)
exportMethods(contributions)
exportMethods(cred_env)
exportMethods(cred_user_pass)
exportMethods(default_signature)
exportMethods(descendant_of)
exportMethods(diff)
exportMethods(discover_repository)
Expand Down
23 changes: 5 additions & 18 deletions R/repository.r
Original file line number Diff line number Diff line change
Expand Up @@ -581,11 +581,9 @@ lookup <- function(repo = NULL, sha = NULL) {
##' Get the signature
##'
##' Get the signature according to the repository's configuration
##' @rdname default_signature-methods
##' @docType methods
##' @param repo The repository \code{object} to check signature
##' @template repo-param
##' @return S4 class git_signature
##' @keywords methods
##' @export
##' @examples
##' \dontrun{
##' ## Initialize a temporary repository
Expand All @@ -605,20 +603,9 @@ lookup <- function(repo = NULL, sha = NULL) {
##' ## Get the default signature
##' default_signature(repo)
##' }
setGeneric("default_signature",
signature = "repo",
function(repo)
standardGeneric("default_signature"))

##' @rdname default_signature-methods
##' @export
setMethod("default_signature",
signature(repo = "git_repository"),
function(repo)
{
.Call(git2r_signature_default, repo)
}
)
default_signature <- function(repo = NULL) {
.Call(git2r_signature_default, lookup_repository(repo))
}

##' Brief summary of repository
##'
Expand Down
13 changes: 6 additions & 7 deletions man/default_signature-methods.Rd → man/default_signature.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 61a7bd7

Please sign in to comment.