summaryrefslogtreecommitdiffstats
path: root/repository.h
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2023-10-02 04:40:07 +0200
committerJunio C Hamano <gitster@pobox.com>2023-10-02 23:57:38 +0200
commit52fca06db28a23fcea159431c1c9dafca26d609c (patch)
treebdb3341d6f511c7b85836272cf6a8b3a193ace77 /repository.h
parentoid-array: teach oid-array to handle multiple kinds of oids (diff)
downloadgit-52fca06db28a23fcea159431c1c9dafca26d609c.tar.xz
git-52fca06db28a23fcea159431c1c9dafca26d609c.zip
object-names: support input of oids in any supported hash
Support short oids encoded in any algorithm, while ensuring enough of the oid is specified to disambiguate between all of the oids in the repository encoded in any algorithm. By default have the code continue to only accept oids specified in the storage hash algorithm of the repository, but when something is ambiguous display all of the possible oids from any accepted oid encoding. A new flag is added GET_OID_HASH_ANY that when supplied causes the code to accept oids specified in any hash algorithm, and to return the oids that were resolved. This implements the functionality that allows both SHA-1 and SHA-256 object names, from the "Object names on the command line" section of the hash function transition document. Care is taken in get_short_oid so that when the result is ambiguous the output remains the same if GIT_OID_HASH_ANY was not supplied. If GET_OID_HASH_ANY was supplied objects of any hash algorithm that match the prefix are displayed. This required updating repo_for_each_abbrev to give it a parameter so that it knows to look at all hash algorithms. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'repository.h')
0 files changed, 0 insertions, 0 deletions