summaryrefslogtreecommitdiff
path: root/tests/pack/packbuilder.c
Commit message (Collapse)AuthorAgeFilesLines
* path: separate git-specific path functions from utilEdward Thomson2021-11-091-2/+2
| | | | | | Introduce `git_fs_path`, which operates on generic filesystem paths. `git_path` will be kept for only git-specific path functionality (for example, checking for `.git` in a path).
* str: introduce `git_str` for internal, `git_buf` is externalethomson/gitstrEdward Thomson2021-10-171-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | libgit2 has two distinct requirements that were previously solved by `git_buf`. We require: 1. A general purpose string class that provides a number of utility APIs for manipulating data (eg, concatenating, truncating, etc). 2. A structure that we can use to return strings to callers that they can take ownership of. By using a single class (`git_buf`) for both of these purposes, we have confused the API to the point that refactorings are difficult and reasoning about correctness is also difficult. Move the utility class `git_buf` to be called `git_str`: this represents its general purpose, as an internal string buffer class. The name also is an homage to Junio Hamano ("gitstr"). The public API remains `git_buf`, and has a much smaller footprint. It is generally only used as an "out" param with strict requirements that follow the documentation. (Exceptions exist for some legacy APIs to avoid breaking callers unnecessarily.) Utility functions exist to convert a user-specified `git_buf` to a `git_str` so that we can call internal functions, then converting it back again.
* hash: hash functions operate on byte arrays not git_oidsEdward Thomson2021-10-021-1/+1
| | | | | | Separate the concerns of the hash functions from the git_oid functions. The git_oid structure will need to understand either SHA1 or SHA256; the hash functions should only deal with the appropriate one of these.
* hash: accept the algorithm in inputsEdward Thomson2021-10-011-1/+1
|
* git_packbuilder_write: Allow setting path to NULL to use the default pathJosh Triplett2020-05-231-0/+9
| | | | | | If given a NULL path, write to the object path of the repository. Add tests for the new behavior.
* tests: pack: add missing asserts around `git_packbuilder_write`Patrick Steinhardt2020-01-091-5/+5
|
* fileops: rename to "futils.h" to match function signaturesPatrick Steinhardt2019-07-201-1/+1
| | | | | | | | | Our file utils functions all have a "futils" prefix, e.g. `git_futils_touch`. One would thus naturally guess that their definitions and implementation would live in files "futils.h" and "futils.c", respectively, but in fact they live in "fileops.h". Rename the files to match expectations.
* indexer: use git_indexer_progress throughoutEdward Thomson2019-02-221-3/+3
| | | | | Update internal usage of `git_transfer_progress` to `git_indexer_progreses`.
* Allow bypassing check '.keep' files using libgit2 option ↵Dhruva Krishnamurthy2019-02-021-0/+10
| | | | 'GIT_OPT_IGNORE_PACK_KEEP_FILE_CHECK'
* object_type: use new enumeration namesethomson/index_fixesEdward Thomson2018-12-011-1/+1
| | | | Use the new object_type enumeration names within the codebase.
* indexer: introduce options struct to `git_indexer_new`Patrick Steinhardt2018-06-221-3/+3
| | | | | | | | | | We strive to keep an options structure to many functions to be able to extend options in the future without breaking the API. `git_indexer_new` doesn't have one right now, but we want to be able to add an option for enabling strict packfile verification. Add a new `git_indexer_options` structure and adjust callers to use that.
* Convert usage of `git_buf_free` to new `git_buf_dispose`Patrick Steinhardt2018-06-101-2/+2
|
* Merge pull request #4088 from chescock/packfile-name-using-complete-hashEdward Thomson2017-06-111-4/+4
|\ | | | | Ensure packfiles with different contents have different names
| * indexer: name pack files after trailer hashChris Hescock2017-05-191-4/+4
| | | | | | | | | | | | | | | | | | | | | | Upstream git.git has changed the way how packfiles are named. Previously, they were using a hash of the contained object's OIDs, which has then been changed to use the hash of the complete packfile instead. See 1190a1acf (pack-objects: name pack files after trailer hash, 2013-12-05) in the git.git repository for more information on this change. This commit changes our logic to match the behavior of core git.
* | settings: rename `GIT_OPT_ENABLE_SYNCHRONOUS_OBJECT_CREATION`Patrick Steinhardt2017-06-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | Initially, the setting has been solely used to enable the use of `fsync()` when creating objects. Since then, the use has been extended to also cover references and index files. As the option is not yet part of any release, we can still correct this by renaming the option to something more sensible, indicating not only correlation to objects. This commit renames the option to `GIT_OPT_ENABLE_FSYNC_GITDIR`. We also move the variable from the object to repository source code.
* | Honor `core.fsyncObjectFiles`ethomson/fsyncEdward Thomson2017-03-021-8/+17
| |
* | win32: don't fsync parent directories on WindowsEdward Thomson2017-02-281-1/+10
| | | | | | | | Windows doesn't support it.
* | fsync: call it "synchronous" object writingEdward Thomson2017-02-281-2/+2
| | | | | | | | | | Rename `GIT_OPT_ENABLE_SYNCHRONIZED_OBJECT_CREATION` -> `GIT_OPT_ENABLE_SYNCHRONOUS_OBJECT_CREATION`.
* | fsync parent directories when fsyncingEdward Thomson2017-02-281-1/+1
| | | | | | | | | | | | When fsync'ing files, fsync the parent directory in the case where we rename a file into place, or create a new file, to ensure that the directory entry is flushed correctly.
* | packbuilder: honor git_object__synchronized_writingEdward Thomson2017-02-281-0/+19
|/ | | | | Honor `git_object__synchronized_writing` when creating a packfile and corresponding index.
* Silence unused return value warningJacques Germishuys2014-09-261-1/+1
|
* Factor 40 and 41 constants from source.Ciro Santilli2014-09-161-2/+2
|
* Fix a bug in the pack::packbuilder suitePhilip Kelley2014-05-171-0/+2
|
* Test cancel from indexer progress callbackRussell Belfer2013-12-111-3/+22
| | | | | | | | | | | | | | | This adds tests that try canceling an indexer operation from within the progress callback. After writing the tests, I wanted to run this under valgrind and had a number of errors in that situation because mmap wasn't working. I added a CMake option to force emulation of mmap and consolidated the Amiga-specific code into that new place (so we don't actually need separate Amiga code now, just have to turn on -DNO_MMAP). Additionally, I made the indexer code propagate error codes more reliably than it used to.
* Update files that reference tests-clarBen Straub2013-11-141-1/+1
|
* Rename tests-clar to testsBen Straub2013-11-141-0/+204