Skip to contents

Show the Git status of the code repository.

Usage

tar_git_status_code(code = getwd())

Arguments

code

Character of length 1, directory path to the code repository, usually the root of the targets project.

Value

If the code repository exists, the return value is the data frame produced by gert::git_status(repo = code). If the code has no Git repository, then the return value is NULL.

Examples

if (Sys.getenv("TAR_EXAMPLES") == "true" && tar_git_ok(verbose = FALSE)) {
targets::tar_dir({ # Containing code does not modify the user's file space.
targets::tar_script(tar_target(data, 1))
targets::tar_make()
list.files("_targets", all.files = TRUE)
gert::git_init()
tar_git_init()
tar_git_status_code()
})
}