]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'bc/sha1-256-interop-02'
authorJunio C Hamano <gitster@pobox.com>
Thu, 12 Mar 2026 17:56:02 +0000 (10:56 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 12 Mar 2026 17:56:02 +0000 (10:56 -0700)
The code to maintain mapping between object names in multiple hash
functions is being added, written in Rust.

* bc/sha1-256-interop-02:
  object-file-convert: always make sure object ID algo is valid
  rust: add a small wrapper around the hashfile code
  rust: add a new binary object map format
  rust: add functionality to hash an object
  rust: add a build.rs script for tests
  rust: fix linking binaries with cargo
  hash: expose hash context functions to Rust
  write-or-die: add an fsync component for the object map
  csum-file: define hashwrite's count as a uint32_t
  rust: add additional helpers for ObjectID
  hash: add a function to look up hash algo structs
  rust: add a hash algorithm abstraction
  rust: add a ObjectID struct
  hash: use uint32_t for object_id algorithm
  conversion: don't crash when no destination algo
  repository: require Rust support for interoperability

1  2 
Makefile
object-file-convert.c
repository.c
repository.h
t/t1006-cat-file.sh
t/test-lib.sh

diff --cc Makefile
Simple merge
Simple merge
diff --cc repository.c
index 8717a1693abd2dbd302496326211f3571b27fc6a,08422d2188098e1037d230f68064481971e6a24c..0b8f7ec20089e0c720affdf2913429bb8c0e14b4
@@@ -1,9 -1,9 +1,10 @@@
  #include "git-compat-util.h"
  #include "abspath.h"
  #include "repository.h"
 +#include "hook.h"
  #include "odb.h"
  #include "config.h"
+ #include "gettext.h"
  #include "object.h"
  #include "lockfile.h"
  #include "path.h"
diff --cc repository.h
index 7830eb7d4bc4bb058f0c20b23545775033d4ee60,46a3beabec926ec4b33778597f65dffe83db36e9..078059a6e02b109f7925be6f1a7acf84a1a63b59
@@@ -220,11 -202,10 +220,11 @@@ struct set_gitdir_args 
  void repo_set_gitdir(struct repository *repo, const char *root,
                     const struct set_gitdir_args *extra_args);
  void repo_set_worktree(struct repository *repo, const char *path);
- void repo_set_hash_algo(struct repository *repo, int algo);
- void repo_set_compat_hash_algo(struct repository *repo, int compat_algo);
+ void repo_set_hash_algo(struct repository *repo, uint32_t algo);
+ void repo_set_compat_hash_algo(struct repository *repo, uint32_t compat_algo);
  void repo_set_ref_storage_format(struct repository *repo,
 -                               enum ref_storage_format format);
 +                               enum ref_storage_format format,
 +                               const char *payload);
  void initialize_repository(struct repository *repo);
  RESULT_MUST_BE_USED
  int repo_init(struct repository *r, const char *gitdir, const char *worktree);
Simple merge
diff --cc t/test-lib.sh
Simple merge