summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* midx: use raw oidsethomson/sha256_rawEdward Thomson2022-01-262-16/+20
| | | | The multi-pack index uses raw object IDs, use a raw type for them.
* index: use raw oidsEdward Thomson2022-01-261-6/+6
| | | | | The index contains entries with raw oids, use a raw oid type for the raw entry data.
* pack: use raw oidsEdward Thomson2022-01-262-18/+25
| | | | | A packfile contains arrays of raw oids, use a raw oid type to index into them.
* commit_graph: use `git_oid_raw`Edward Thomson2022-01-262-17/+20
| | | | | The commit graph consists of raw oids in an array; use the `git_oid_raw` type to access them.
* oid: introduce `git_oid_cpy_raw`Edward Thomson2022-01-262-2/+9
|
* oid: introduce `git_oid_raw_ncmp`Edward Thomson2022-01-262-19/+24
|
* oid: `hashcmp` is now `raw_cmp`Edward Thomson2022-01-263-5/+7
| | | | | We will talk about "raw" oids as untyped blobs of data; use a name for the comparison function that is in keeping with that.
* tests: don't cast raw data to a `git_oid``Edward Thomson2022-01-232-4/+12
| | | | Create an object id from raw data instead of casting.
* indexer: write raw id dataEdward Thomson2022-01-231-1/+1
| | | | Don't write the object id structure, write its raw oid data.
* treecache: write the raw id not the objectEdward Thomson2022-01-231-1/+1
| | | | | We explicitly want to write on the id data, not the beginning of the object data, which may contain other information in the future.
* oidmap: hash on the id, not the objectEdward Thomson2022-01-231-1/+1
| | | | | We explicitly want to hash on the id data, not the beginning of the object data, which may contain other information in the future.
* oid: don't assume the size of an oidEdward Thomson2022-01-232-2/+2
| | | | | Don't assume that a `git_oid` is a particular size; allocate `sizeof(git_oid)` instead.
* tree: move git_oid into tree entryEdward Thomson2022-01-236-30/+23
| | | | | | | | | | | | A tree entry previously pointed directly into the object id within the tree object itself; this is useful to avoid any unnecessary memory copy (and an unnecessary use of 40 bytes per tree entry) but difficult if we change the underlying `git_oid` object to not simply be a raw object id but have additional structure. This commit moves the `git_oid` directly into the tree entry; this simplifies the tree entry creation from user data. We now copy the `git_oid` into place when parsing.
* --------------------------Edward Thomson2022-01-230-0/+0
|
* sha: cast nonsense for obnoxious gcc warningsEdward Thomson2022-01-231-7/+7
| | | | | gcc (mingw) warns when you cast the result of `GetProcAddress`; cast the results to `void *` before casting them to the actual result.
* sha: ensure we test both cng and cryptoapi on windowsEdward Thomson2022-01-234-0/+90
| | | | | When GIT_SHA1_WIN32 or GIT_SHA256_WIN32 is used, ensure that we test both CryptoNG ("cng") and CryptoAPI.
* sha: support Win32 for SHA256Edward Thomson2022-01-235-192/+317
| | | | | Adding SHA256 support prompted an overdue refactoring of some of the unnecessary complexity around the CNG/CryptoAPI abstraction.
* sha: support OpenSSL for SHA256Edward Thomson2022-01-236-11/+83
|
* sha: support mbedTLS for SHA256Edward Thomson2022-01-236-8/+80
|
* sha: support CommonCrypto for SHA256Edward Thomson2022-01-237-11/+95
|
* sha: GIT_ERROR_SHA1 is deprecated in favor of GIT_ERROR_SHAEdward Thomson2022-01-235-7/+9
| | | | The more generic GIT_ERROR_SHA allows for SHA256 errors as well as SHA1.
* sha: add sha256 algorithmEdward Thomson2022-01-2314-4/+1221
| | | | | Add support for a SHA256 hash algorithm, and add the "builtin" SHA256 hash engine (from RFC 6234).
* sha1: refactor folder structureEdward Thomson2022-01-2317-30/+32
| | | | | Eliminate the `sha1` folder, move it down into `hash` so that future impelmentations can share common code.
* sha1: remove generic implementationEdward Thomson2022-01-236-327/+4
| | | | | | Remove the "generic" implementation; it should never be used; it only existed for a no-dependencies configuration, and our bundled sha1dc satisfies that requirement _and_ is correct.
* ---------------------------------Edward Thomson2022-01-230-0/+0
|
* packbuilder: use the packfile name instead of hashethomson/oid_cleanupsEdward Thomson2022-01-236-17/+44
| | | | | Deprecate the `git_packfile_hash` function. Callers should use the new `git_packfile_name` function which provides a unique packfile name.
* indexer: use a byte array for checksumEdward Thomson2022-01-235-31/+53
| | | | | | | | The index's checksum is not an object ID, so we should not use the `git_oid` type. Use a byte array for checksum calculation and storage. Deprecate the `git_indexer_hash` function. Callers should use the new `git_indexer_name` function which provides a unique packfile name.
* index: use a byte array for checksumEdward Thomson2022-01-234-48/+55
| | | | | | | | | | | The index's checksum is not an object ID, so we should not use the `git_oid` type. Use a byte array for checksum calculation and storage. Deprecate the `git_index_checksum` function without a replacement. This is an abstraction that callers should not care about (and indeed do not seem to be using). Remove the unused `git_index__changed_relative_to` function.
* config: use a byte array for checksumEdward Thomson2022-01-221-5/+6
|
* commit_graph: use a byte array for checksumEdward Thomson2022-01-222-12/+20
|
* midx: use a byte array for checksumEdward Thomson2022-01-222-13/+21
|
* hash: introduce git_hash_fmtEdward Thomson2022-01-222-0/+18
| | | | A simple hash-to-hexadigit formatter.
* oid: avoid `tostr_s` in many placesEdward Thomson2022-01-222-2/+8
| | | | | | The `git_oid_tostr_s` helper is indeed helpful, unless you are using printf debugging (by inserting more `git_oid_tostr_s` calls) shortly after using it. Avoid it before invoking complex functions.
* commit_graph: tests are now `commitgraph`Edward Thomson2022-01-221-3/+3
| | | | | | Underscores in filenames in tests indicate a logical separation - so `commit_graph` becomes `commit::graph`. Rename it to `commitgraph` to avoid this.
* Merge pull request #6184 from boretrk/noflexarrayEdward Thomson2022-01-201-9/+7
|\ | | | | diff_driver: split global_drivers array into separate elements
| * diff_driver: split global_drivers array into separate elementsPeter Pettersson2022-01-201-9/+7
| | | | | | | | | | C99 doesn't allow structures with flexible length array to be placed in an array.
* | Merge pull request #6180 from libgit2/ethomson/win32_findfile_fixesEdward Thomson2022-01-1910-107/+796
|\ \ | |/ |/| win32: update git for windows compatibility
| * win32: improve impl & tests for system path / g4w interopethomson/win32_findfile_fixesEdward Thomson2022-01-175-271/+490
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We look for a Git for Windows installation to use its git config, so that clients built on libgit2 can interoperate with the Git for Windows CLI (and clients that are built on top of _it_). Look for `git` both in the `PATH` and in the registry. Use the _first_ git install in the path, and the first git install in the registry. Look in both the `etc` dir and the architecture-specific `etc` dirs (`mingw64/etc` and `mingw32/etc`) beneath the installation root. Prefer the git in the `PATH` to the git location in the registry so that users can override that. Include more tests for this behavior.
| * path: introduce git_fs_path_find_executableEdward Thomson2022-01-175-0/+281
| | | | | | | | | | Provide a helper function to find an executable in the current process's PATH.
| * win32: remove unnecessary findfile structureEdward Thomson2022-01-171-42/+37
| |
| * win32: test system paths for gvfs compatibilityEdward Thomson2022-01-173-26/+144
| |
| * sysdir: allow resetting cached system dirsEdward Thomson2022-01-172-0/+21
| |
| * Correctly detect the share/template folderSven Strickroth2022-01-171-9/+50
| | | | | | | | | | | | | | | | With Git for Windows >= 2 the share folder is in an architecture specific subfolder. This also add support for Git for Windows versions between 2 and 2.24 where also the etc folder is in an architecture specific subfolder. Signed-off-by: Sven Strickroth <email@cs-ware.de>
| * Detect installed x64 versions of Git for WindowsSven Strickroth2022-01-171-0/+6
| | | | | | | | Signed-off-by: Sven Strickroth <email@cs-ware.de>
| * Do not unconditionally remove the last 4 chars of the directory where ↵Sven Strickroth2022-01-171-3/+11
| | | | | | | | | | | | | | | | | | | | git.exe was found Removal of the last 4 chars is only required for Git for Windows installations in order to find the "root" folder of the Git installation. Fixes issue #5127. Signed-off-by: Sven Strickroth <email@cs-ware.de>
| * Prevent possible buffer overflowSven Strickroth2022-01-171-1/+1
| | | | | | | | | | | | Could happen if the path to git.exe is near to MAX_PATH and we append a longer subdir such as "share/git-core" to it. Signed-off-by: Sven Strickroth <email@cs-ware.de>
* | Merge pull request #6168 from punkymaniac/patch-documentation-2Edward Thomson2022-01-1732-9/+144
|\ \ | |/ |/| Improve documentation
| * Apply suggestions from code reviewEdward Thomson2022-01-1710-14/+13
| |
| * Set parameter name as function declarationpunkymaniac2022-01-122-2/+2
| |
| * Separate function description from short descriptionpunkymaniac2022-01-111-6/+7
| |