Learn R Programming

git2r (version 0.21.0)

is_bare: Check if repository is bare

Description

Check if repository is bare

Usage

is_bare(repo)

# S4 method for git_repository is_bare(repo)

# S4 method for missing is_bare()

Arguments

repo

The repository object '>git_repository to check if it's bare. If the repo argument is missing, the repository is searched for with discover_repository in the current working directory.

Value

TRUE if bare repository, else FALSE

See Also

init

Examples

Run this code
# NOT RUN {
## Initialize a repository
path <- tempfile(pattern="git2r-")
dir.create(path)
repo <- init(path)
is_bare(repo)

## Initialize a bare repository
path_bare <- tempfile(pattern="git2r-")
dir.create(path_bare)
repo_bare <- init(path_bare, bare = TRUE)
is_bare(repo_bare)
# }

Run the code above in your browser using DataLab