3 ms·
Every object in the repository, including commits and trees, is hashed via SHA-1. Commits also include the SHA of the previous commit, so if you verify each com
by Hello71 13y ago
Every object in the repository, including commits and trees, is hashed via SHA-1. Commits also include the SHA of the previous commit, so if you verify each commit, then compare the SHA at the top to the "correct" one, then that means your entire repository is valid.
- masklinn 13y ago> Every object in the repository, including commits and trees, is hashed via SHA-1. Commits also include the SHA of the previous commit mercurial does pretty much the same, as far as I know. > so if you verify each commit But surely that does not happen on every CLI operation does it? So you only find out about corruption when all the repository is traversed and checked, which will usually be explicitly or on clone. Thus the same as hg.
- DannyBee 13y agoactually, it's possible to execute clone in git without it checking. If you do a local clone, it will happily hand you a broken repo.