diff options
| author | Junio C Hamano <gitster@pobox.com> | 2021-05-10 16:59:46 +0900 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2021-05-10 16:59:46 +0900 |
| commit | aaa3c8065d86e8f25850eb79e90da68d6adcf03f (patch) | |
| tree | ac8883284fe2e056252c14f6916e5ee9312eff1a /archive.c | |
| parent | 2d677e5b1537692a4f875740a6e9853c24285f02 (diff) | |
| parent | 3dd71461e25b4cc7ea2a2d8deef1c0486bb32580 (diff) | |
| download | git-aaa3c8065d86e8f25850eb79e90da68d6adcf03f.tar.gz | |
Merge branch 'bc/hash-transition-interop-part-1'
SHA-256 transition.
* bc/hash-transition-interop-part-1:
hex: print objects using the hash algorithm member
hex: default to the_hash_algo on zero algorithm value
builtin/pack-objects: avoid using struct object_id for pack hash
commit-graph: don't store file hashes as struct object_id
builtin/show-index: set the algorithm for object IDs
hash: provide per-algorithm null OIDs
hash: set, copy, and use algo field in struct object_id
builtin/pack-redundant: avoid casting buffers to struct object_id
Use the final_oid_fn to finalize hashing of object IDs
hash: add a function to finalize object IDs
http-push: set algorithm when reading object ID
Always use oidread to read into struct object_id
hash: add an algo member to struct object_id
Diffstat (limited to 'archive.c')
| -rw-r--r-- | archive.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -203,7 +203,7 @@ static void queue_directory(const unsigned char *sha1, d->mode = mode; c->bottom = d; d->len = xsnprintf(d->path, len, "%.*s%s/", (int)base->len, base->buf, filename); - hashcpy(d->oid.hash, sha1); + oidread(&d->oid, sha1); } static int write_directory(struct archiver_context *c) @@ -275,9 +275,11 @@ int write_archive_entries(struct archiver_args *args, int err; struct strbuf path_in_archive = STRBUF_INIT; struct strbuf content = STRBUF_INIT; - struct object_id fake_oid = null_oid; + struct object_id fake_oid; int i; + oidcpy(&fake_oid, null_oid()); + if (args->baselen > 0 && args->base[args->baselen - 1] == '/') { size_t len = args->baselen; |
