git_handler: fix hgsubstate generation
Before this patch, in the git to hg conversion, .hgsubstate once created is never deleted, even if no submodules are any longer present. This is broken state, as shown by the test for which the SHA changes. Fix that by looking at the diff instead of just what submodules are present. Since 'gitlinks' now contains *changed* gitlinks, not *all* gitlinks, it no longer makes sense to gate gitmodules checks on that. This patch simply demonstrates that the test was broken; an upcoming patch will introduce more tests. Bonus: this also makes the import process faster because we no longer need to walk the entire tree to collect gitlinks. This will cause the SHAs of repos that have submodules added and then removed to change.
Loading
Please register or sign in to comment