summaryrefslogtreecommitdiffstats
path: root/t/t5550-http-fetch-dumb.sh
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2020-05-25 21:59:19 +0200
committerJunio C Hamano <gitster@pobox.com>2020-05-27 19:07:07 +0200
commitd96dab868e63cd5a55b50e1d8a23b640e17413bb (patch)
tree6aed81c6e05d178708857c626135b33a43015a4c /t/t5550-http-fetch-dumb.sh
parentt5500: make hash independent (diff)
downloadgit-d96dab868e63cd5a55b50e1d8a23b640e17413bb.tar.xz
git-d96dab868e63cd5a55b50e1d8a23b640e17413bb.zip
builtin/ls-remote: initialize repository based on fetch
ls-remote may or may not operate within a repository, and as such will not have been initialized with the repository's hash algorithm. Even if it were, the remote side could be using a different algorithm and we would still want to display those refs properly. Find the hash algorithm used by the remote side by querying the transport object and set our hash algorithm accordingly. Without this change, if the remote side is using SHA-256, we truncate the refs to 40 hex characters, since that's the length of the default hash algorithm (SHA-1). Note that technically this is not a correct setting of the repository hash algorithm since, if we are in a repository, it might be one of a different hash algorithm from the remote side. However, our current code paths don't handle multiple algorithms and won't for some time, so this is the best we can do. We rely on the fact that ls-remote never modifies the current repository, which is a reasonable assumption to make. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to '')
0 files changed, 0 insertions, 0 deletions