Skip to content

Commit

Permalink
Update citation_meta_class.R
Browse files Browse the repository at this point in the history
This should fix a bug where `.zenodo.json` file was incorrectly flagged as modified.
The relative path to the file should be relative to the root of the git repository.
This failed in cases where `meta$path` is a child directory beneath the git root repository.
The `gert` package uses `gert::git_find` to find the git parent directory in case a child directory is passed to the `repo = ` argument.
  • Loading branch information
hansvancalster authored Dec 19, 2023
1 parent 3413f5f commit 5632ff7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion R/citation_meta_class.R
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ validate_citation <- function(meta) {
#' @importFrom fs path
#' @importFrom jsonlite toJSON
#' @importFrom knitr pandoc
#' @importFrom gert git_find
citation_zenodo <- function(meta) {
assert_that(inherits(meta, "citation_meta"))
assert_that(length(meta$get_errors) == 0)
Expand Down Expand Up @@ -297,7 +298,7 @@ citation_zenodo <- function(meta) {
"Please commit changes."
)[
!is_tracked_not_modified(
path_rel(citation_file, meta$get_path), meta$get_path
path_rel(citation_file, git_find(meta$get_path)), meta$get_path
)
]
return(errors)
Expand Down

0 comments on commit 5632ff7

Please sign in to comment.