[2.46 regression] git ls-remote crash with import remote-helper
- From
Mike Hommey <mh@glandium.org>
- Date
- Jul 27, 2024, 19:19 UTC
- Message-ID
- <20240727191917.p64ul4jybpm2a7hm@glandium.org>
Hi,
Running `git ls-remote $helper::$url` crashes when run outside a git repo and the helper uses the import feature.
Here is a minimal reproducer: ``` $ cat > git-remote-foo <<EOF #!/bin/sh echo import echo refspec '*:*' EOF $ chmod +x git-remote-foo $ PATH=$PWD:$PATH git ls-remote foo::bar ```
The crash happens in parse_refspec in refspec.c, on a deref of the_hash_algo, because the_hash_also is not set anymore at that point since c8aed5e8da.
Mike