diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2023-04-05 10:39:01 +0100 |
---|---|---|
committer | Edward Thomson <ethomson@edwardthomson.com> | 2023-04-05 10:39:01 +0100 |
commit | 751887211b9f9fde4eff15018d2b524da55274d2 (patch) | |
tree | c59f9815cd971168a9bc2c90ef9a2066ebdd8d43 /src/libgit2/index.h | |
parent | f7fd9ce947fc2189ce80abc31fdc6077df94f73b (diff) | |
download | libgit2-ethomson/sha256_index.tar.gz |
index: add sha256 supportethomson/sha256_index
Diffstat (limited to 'src/libgit2/index.h')
-rw-r--r-- | src/libgit2/index.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/libgit2/index.h b/src/libgit2/index.h index 71bb096f7..53c29977d 100644 --- a/src/libgit2/index.h +++ b/src/libgit2/index.h @@ -27,7 +27,7 @@ struct git_index { char *index_file_path; git_futils_filestamp stamp; - unsigned char checksum[GIT_HASH_SHA1_SIZE]; + unsigned char checksum[GIT_HASH_MAX_SIZE]; git_vector entries; git_idxmap *entries_map; @@ -35,6 +35,8 @@ struct git_index { git_vector deleted; /* deleted entries if readers > 0 */ git_atomic32 readers; /* number of active iterators */ + git_oid_t oid_type; + unsigned int on_disk:1; unsigned int ignore_case:1; unsigned int distrust_filemode:1; @@ -141,6 +143,17 @@ GIT_INLINE(unsigned char *) git_index__checksum(git_index *index) return index->checksum; } +/* SHA256-aware internal functions */ + +extern int git_index__new( + git_index **index_out, + git_oid_t oid_type); + +extern int git_index__open( + git_index **index_out, + const char *index_path, + git_oid_t oid_type); + /* Copy the current entries vector *and* increment the index refcount. * Call `git_index__release_snapshot` when done. */ |