summaryrefslogtreecommitdiff
path: root/tests/diff/blob.c
Commit message (Collapse)AuthorAgeFilesLines
* oid: `is_zero` instead of `iszero`Edward Thomson2019-06-161-10/+10
| | | | | | The only function that is named `issomething` (without underscore) was `git_oid_iszero`. Rename it to `git_oid_is_zero` for consistency with the rest of the library.
* Rename opt init functions to `options_init`Edward Thomson2019-06-141-1/+1
| | | | | | | | | | | | | In libgit2 nomenclature, when we need to verb a direct object, we name a function `git_directobject_verb`. Thus, if we need to init an options structure named `git_foo_options`, then the name of the function that does that should be `git_foo_options_init`. The previous names of `git_foo_init_options` is close - it _sounds_ as if it's initializing the options of a `foo`, but in fact `git_foo_options` is its own noun that should be respected. Deprecate the old names; they'll now call directly to the new ones.
* git_error: use new names in internal APIs and usageEdward Thomson2019-01-221-4/+4
| | | | | Move to the `git_error` name in the internal API for error-related functions.
* Convert usage of `git_buf_free` to new `git_buf_dispose`Patrick Steinhardt2018-06-101-2/+2
|
* diff_file: properly refcount blobs when initializing file contentsPatrick Steinhardt2017-12-151-0/+39
| | | | | | | | | | | | | | When initializing a `git_diff_file_content` from a source whose data is derived from a blob, we simply assign the blob's pointer to the resulting struct without incrementing its refcount. Thus, the structure can only be used as long as the blob is kept alive by the caller. Fix the issue by using `git_blob_dup` instead of a direct assignment. This function will increment the refcount of the blob without allocating new memory, so it does exactly what we want. As `git_diff_file_content__unload` already frees the blob when `GIT_DIFF_FLAG__FREE_BLOB` is set, we don't need to add new code handling the free but only have to set that flag correctly.
* test-diff-blob: Pass proper nibble sizesvmg/prefix-lenVicent Marti2015-06-261-14/+14
|
* diff: introduce binary diff callbacksEdward Thomson2015-06-121-28/+28
| | | | | | | Introduce a new binary diff callback to provide the actual binary delta contents to callers. Create this data from the diff contents (instead of directly from the ODB) to support binary diffs including the workdir, not just things coming out of the ODB.
* Introduce cl_assert_equal_oidEdward Thomson2014-07-011-6/+6
|
* Get rid of redundant git_diff_options_init fnRussell Belfer2014-05-021-1/+1
| | | | Since git_diff_init_options was introduced, remove this old fn.
* Add buffer to buffer diff and patch APIsRussell Belfer2014-02-271-150/+90
| | | | | | | | This adds `git_diff_buffers` and `git_patch_from_buffers`. This also includes a bunch of internal refactoring to increase the shared code between these functions and the blob-to-blob and blob-to-buffer APIs, as well as some higher level assert helpers in the tests to also remove redundancy.
* Merge pull request #2066 from libgit2/rb/builtin-diff-driversVicent Marti2014-01-271-4/+4
|\ | | | | Add built in diff drivers
| * Update all tests for new pattern extractionRussell Belfer2014-01-241-4/+4
| |
* | diff: rename the file's 'oid' to 'id'Carlos Martín Nieto2014-01-251-16/+16
|/ | | | In the same vein as the previous commits in this series.
* Drop git_patch_to_strNicolas Hake2014-01-221-25/+26
| | | | | | | It's hard or even impossible to correctly free the string buffer allocated by git_patch_to_str in some circumstances. Drop the function so people have to use git_patch_to_buf instead - git_buf has a dedicated destructor.
* Rename tests-clar to testsBen Straub2013-11-141-0/+1067