]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'tb/weak-sha1-for-tail-sum'
authorJunio C Hamano <gitster@pobox.com>
Wed, 2 Oct 2024 14:46:27 +0000 (07:46 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 2 Oct 2024 14:46:27 +0000 (07:46 -0700)
The checksum at the tail of files are now computed without
collision detection protection.  This is safe as the consumer of
the information to protect itself from replay attacks checks for
hash collisions independently.

* tb/weak-sha1-for-tail-sum:
  csum-file.c: use unsafe SHA-1 implementation when available
  Makefile: allow specifying a SHA-1 for non-cryptographic uses
  hash.h: scaffolding for _unsafe hashing variants
  sha1: do not redefine `platform_SHA_CTX` and friends
  pack-objects: use finalize_object_file() to rename pack/idx/etc
  finalize_object_file(): implement collision check
  finalize_object_file(): refactor unlink_or_warn() placement
  finalize_object_file(): check for name collision before renaming

1  2 
Makefile
object-file.c
pack-write.c
tmp-objdir.c

diff --cc Makefile
Simple merge
diff --cc object-file.c
Simple merge
diff --cc pack-write.c
Simple merge
diff --cc tmp-objdir.c
index c2fb9f91930a30bdbd813112517d7c9eafde1858,9556f8fcdb74b1923028a0ad74fdedcbdaad56d4..9da0071cba837586241994367d0d3392dbb1bfab
@@@ -269,9 -279,9 +281,9 @@@ int tmp_objdir_migrate(struct tmp_objdi
        }
  
        strbuf_addbuf(&src, &t->path);
 -      strbuf_addstr(&dst, get_object_directory());
 +      strbuf_addstr(&dst, repo_get_object_directory(the_repository));
  
-       ret = migrate_paths(&src, &dst);
+       ret = migrate_paths(&src, &dst, 0);
  
        strbuf_release(&src);
        strbuf_release(&dst);