From 5f53e96191ee161596b7a53ea5743d1eb3e01618 Mon Sep 17 00:00:00 2001 From: brycefrank Date: Mon, 30 Sep 2024 13:28:20 -0700 Subject: [PATCH] adding current_commit arg to write_update_commit --- R/mongo.R | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/R/mongo.R b/R/mongo.R index b3b7659..bab9a54 100644 --- a/R/mongo.R +++ b/R/mongo.R @@ -97,8 +97,10 @@ get_last_update_commit <- function(update_con) { } } -write_update_commit <- function(update_con) { - current_commit <- system("git rev-parse HEAD", intern = TRUE) +write_update_commit <- function(update_con, current_commit = NULL) { + if(!is.null(current_commit)) { + current_commit <- system("git rev-parse HEAD", intern = TRUE) + } insert_obj <- list( datetime = as.integer(Sys.time()) |> jsonlite::unbox(),