Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop progress_cb from generating spurious warnings #243

Merged
merged 3 commits into from
Jul 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions godot-git-plugin/src/git_callbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}

Expand Down
Loading