I've written an open-source app to clone remote repos from well-known Git hosting providers and create bundles from them, for backup purposes. Subsequent runs of the app re-clone, re-bundle, and compare size and hash to determine if it's a new version to archive, or if it's the same and can be discarded.
To save time and bandwidth, I'm trialling a feature to compare bundle and remote refs to determine if they are identical or not, i.e. get the output of both of the following commands and compare refs:
git bundle list-heads myrepo.202211012056.bundle
git ls-remote https://example.com/myrepo.git
With output looking something like this for each command:
86c9f38dc2e3edc34cfcccad3f3cf7f91a2bbe8d refs/heads/lotsatests
3901f7a0950be9a252aa3020bb8dd607edc6fdf0 refs/heads/main
9f427e597b6dd9e354881a30ba586b729cce3811 refs/tags/0.0.1
3901f7a0950be9a252aa3020bb8dd607edc6fdf0 HEAD
Limited testing suggests the comparison of output from both commands is sufficient to determine if the repos are identical, but are there any gotchas I should be aware of?