Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2020-06-19 20:55:54 +0300
committerJunio C Hamano <gitster@pobox.com>2020-06-20 00:04:08 +0300
commit97997e6ad2790e58c727c180548a3d0073c4c1d2 (patch)
treecda38ea87b2552030b84b457ddd4d6db71ba1ea8 /remote-curl.c
parent793731f742ab1df28deb289714e61244e3de3b37 (diff)
remote-curl: avoid truncating refs with ls-remote
Normally, the remote-curl transport helper is aware of the hash algorithm we're using because we're in a repo with the appropriate hash algorithm set. However, when using git ls-remote outside of a repository, we won't have initialized the hash algorithm properly, so use hash_to_hex_algop to print the ref corresponding to the algorithm we've detected. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'remote-curl.c')
-rw-r--r--remote-curl.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/remote-curl.c b/remote-curl.c
index 774a1ca71f..0090e68f4a 100644
--- a/remote-curl.c
+++ b/remote-curl.c
@@ -548,7 +548,9 @@ static void output_refs(struct ref *refs)
if (posn->symref)
printf("@%s %s\n", posn->symref, posn->name);
else
- printf("%s %s\n", oid_to_hex(&posn->old_oid), posn->name);
+ printf("%s %s\n", hash_to_hex_algop(posn->old_oid.hash,
+ options.hash_algo),
+ posn->name);
}
printf("\n");
fflush(stdout);