Check if repository is bare

Share:

Description

Check if repository is bare

Usage

1
2
3
4
5
6
7
is_bare(repo)

## S4 method for signature 'git_repository'
is_bare(repo)

## S4 method for signature '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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## 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)

## End(Not run)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.