Skip to content

Commit e86106b

Browse files
authored
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.
1 parent f6002fa commit e86106b

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

godot-git-plugin/src/git_callbacks.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,7 @@
1010
extern "C" int progress_cb(const char *str, int len, void *data) {
1111
(void)data;
1212

13-
char *progress_str = new char[len + 1];
14-
std::memcpy(progress_str, str, len);
15-
progress_str[len] = '\0';
16-
godot::UtilityFunctions::push_warning("remote: ", godot::String::utf8(progress_str).strip_edges());
17-
delete[] progress_str;
13+
godot::UtilityFunctions::print("remote: ", godot::String::utf8(str, len).strip_edges());
1814

1915
return 0;
2016
}
@@ -63,7 +59,7 @@ extern "C" int push_transfer_progress_cb(unsigned int current, unsigned int tota
6359
progress = (current * 100) / total;
6460
}
6561

66-
godot::UtilityFunctions::print("Writing Objects: ", uint32_t(progress), "% (", uint32_t(current), "/", uint32_t(total), ", ", uint32_t(bytes), " bytes done.");
62+
godot::UtilityFunctions::print("Writing Objects: ", uint32_t(progress), "% (", uint32_t(current), "/", uint32_t(total), ", ", uint32_t(bytes), " bytes done.)");
6763
return 0;
6864
}
6965

0 commit comments

Comments
 (0)