mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
loose: add a mapping between SHA-1 and SHA-256 for loose objects
As part of the transition plan, we'd like to add a file in the .git directory that maps loose objects between SHA-1 and SHA-256. Let's implement the specification in the transition plan and store this data on a per-repository basis in struct repository. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
15a1ca1abe
commit
23b2c7e95b
@@ -4,6 +4,7 @@
|
||||
#include "repository.h"
|
||||
#include "hash-ll.h"
|
||||
#include "object.h"
|
||||
#include "loose.h"
|
||||
#include "object-file-convert.h"
|
||||
|
||||
int repo_oid_to_algop(struct repository *repo, const struct object_id *src,
|
||||
@@ -21,7 +22,18 @@ int repo_oid_to_algop(struct repository *repo, const struct object_id *src,
|
||||
oidcpy(dest, src);
|
||||
return 0;
|
||||
}
|
||||
return -1;
|
||||
if (repo_loose_object_map_oid(repo, src, to, dest)) {
|
||||
/*
|
||||
* We may have loaded the object map at repo initialization but
|
||||
* another process (perhaps upstream of a pipe from us) may have
|
||||
* written a new object into the map. If the object is missing,
|
||||
* let's reload the map to see if the object has appeared.
|
||||
*/
|
||||
repo_read_loose_object_map(repo);
|
||||
if (repo_loose_object_map_oid(repo, src, to, dest))
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int convert_object_file(struct strbuf *outbuf,
|
||||
|
||||
Reference in New Issue
Block a user