Add support for SHA-256-hashed repositories
Hi!
Does by any chance this plugin fail to work with SHA256 repositories?
ERROR: core/variant/variant_utility.cpp:1098 - GitPlugin: Could not initialize repository. Error -1: unsupported extension name extensions.objectformat in godot-git-plugin\src\git_plugin.cpp:GitPlugin::_initialize#L695
ERROR: Could not initialize GitPlugin
This is the error I get when trying to turn on VSC for my project. Note that my project was initialized with default Git source control metadata; I then deleted the .git folder to initialize a new repository using git init --object-format=sha256.
I have tried to turn on VSC for an older project that uses default SHA1 and it works as expected.
I doubt alternative hashing methods were implemented in this plugin, so only SHA-1 will work for now. Feel free to open a pull request to add support for SHA-256 🙂
For context, Git added support for alternative hashing methods following SHAttered in 2017. It's still not the default for new repositories in 2025 though, as many Git hosts and programs don't support it.
I doubt alternative hashing methods were implemented in this plugin
That's good to know. I was kind of aware of the risks of using a relatively new hashing method, though didn't expect it would actually be this bad. For now, I'll better keep using SHA-1 since too many things are just broken with 256.
Maybe one day I'll beat my fear to C++ to try and contribute to the project 😛