From e86106b8c25ec1a65474184d9246f0fd0e4e850d Mon Sep 17 00:00:00 2001 From: Joel Croteau Date: Sat, 6 Jul 2024 22:15:37 -0500 Subject: [PATCH] Stop `progress_cb` from generating spurious warnings (#243) `progress_cb` is used to give progress updates on pushes and pulls. There is no reason for it to pollute the logs by logging its updates as warnings. Changed these to plain print statements. --- godot-git-plugin/src/git_callbacks.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/godot-git-plugin/src/git_callbacks.cpp b/godot-git-plugin/src/git_callbacks.cpp index 7b5aff1..b655e1c 100644 --- a/godot-git-plugin/src/git_callbacks.cpp +++ b/godot-git-plugin/src/git_callbacks.cpp @@ -10,11 +10,7 @@ extern "C" int progress_cb(const char *str, int len, void *data) { (void)data; - char *progress_str = new char[len + 1]; - std::memcpy(progress_str, str, len); - progress_str[len] = '\0'; - godot::UtilityFunctions::push_warning("remote: ", godot::String::utf8(progress_str).strip_edges()); - delete[] progress_str; + godot::UtilityFunctions::print("remote: ", godot::String::utf8(str, len).strip_edges()); return 0; } @@ -63,7 +59,7 @@ extern "C" int push_transfer_progress_cb(unsigned int current, unsigned int tota progress = (current * 100) / total; } - godot::UtilityFunctions::print("Writing Objects: ", uint32_t(progress), "% (", uint32_t(current), "/", uint32_t(total), ", ", uint32_t(bytes), " bytes done."); + godot::UtilityFunctions::print("Writing Objects: ", uint32_t(progress), "% (", uint32_t(current), "/", uint32_t(total), ", ", uint32_t(bytes), " bytes done.)"); return 0; }