summaryrefslogtreecommitdiff
path: root/src/blame.c
Commit message (Collapse)AuthorAgeFilesLines
* blame: handle error when resoling HEAD in normalize_optionsPatrick Steinhardt2016-03-111-3/+8
| | | | | | | | | When normalizing options we try to look up HEAD's OID. While this action may fail in malformed repositories we never check the return value of the function. Fix the issue by converting `normalize_options` to actually return an error and handle the error in `git_blame_file`.
* blame: use size_t for line counts in git_blame_hunkPatrick Steinhardt2015-12-011-12/+12
| | | | | | | | | | It is not unreasonable to have versioned files with a line count exceeding 2^16. Upon blaming such files we fail to correctly keep track of the lines as `git_blame_hunk` stores them in `uint16_t` fields. Fix this by converting the line fields of `git_blame_hunk` to `size_t`. Add test to verify behavior.
* blame: guard xdiff calls for large filesEdward Thomson2015-10-051-1/+1
|
* diff: introduce binary diff callbacksEdward Thomson2015-06-121-2/+2
| | | | | | | 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.
* allocations: test for overflow of requested sizeEdward Thomson2015-02-121-2/+26
| | | | | Introduce some helper macros to test integer overflow from arithmetic and set error message appropriately.
* Several CppCat warnings fixedArkady Shapkin2014-09-031-1/+0
|
* Make init_options fns use unsigned ints and macroRussell Belfer2014-05-021-9/+4
| | | | | Use an unsigned int for the version and add a helper macro so the code is simplified (and so the error message is a common string).
* blame: Fix compare function's data typesJiri Pospisil2014-03-071-6/+9
| | | | | | | | | | Previously the hunk_byfinalline_search_cmp function was called with different data types (size_t and uint32_t) for the key argument but expected only the former resulting in an invalid memory access when passed the latter on a 64 bit machine. The following patch makes sure that the function is called and works with the same type (size_t).
* Added function-based initializers for every options struct.Matthew Bowen2014-03-051-0/+12
| | | | The basic structure of each function is courtesy of arrbee.
* Some fixes for Windows x64 warningsRussell Belfer2014-01-301-1/+1
|
* Align git_signature_dup.Arthur Schreiber2014-01-141-4/+4
| | | | | | This changes git_signature_dup to actually honor oom conditions raised by the call to git__strdup. It also aligns it with the error code return pattern used everywhere else.
* Fix a double free issue in `git_blame__alloc`.Arthur Schreiber2014-01-131-1/+0
| | | | `git_blame_free` already calls `git__free` on `gbr`.
* Add orig_commit.XTao2014-01-081-2/+4
|
* Cleanups, renames, and leak fixesRussell Belfer2013-12-121-1/+1
| | | | | | | | | This renames git_vector_free_all to the better git_vector_free_deep and also contains a couple of memory leak fixes based on valgrind checks. The fixes are specifically: failure to free global dir path variables when not compiled with threading on and failure to free filters from the filter registry that had not be initialized fully.
* Add git_vector_free_allRussell Belfer2013-12-111-4/+1
| | | | | | There are a lot of places that we call git__free on each item in a vector and then call git_vector_free on the vector itself. This just wraps that up into one convenient helper function.
* Improve GIT_EUSER handlingRussell Belfer2013-12-111-9/+15
| | | | | | | | | | | This adds giterr_user_cancel to return GIT_EUSER and clear any error message that is sitting around. As a result of using that in places, we need to be more thorough with capturing errors that happen inside a callback when used internally. To help with that, this also adds giterr_capture and giterr_restore so that when we internally use a foreach-type function that clears errors and converts them to GIT_EUSER, it is easier to restore not just the return value, but the actual error message text.
* blame.c: Remove unnecessary error-check and gotoPaul Holden2013-12-051-2/+0
| | | | In private function 'load_blob'.
* Don't leak memory when duplicating a NULL signatureBen Straub2013-11-121-4/+2
|
* Fix buffer blame with new lines at end of fileBen Straub2013-11-121-9/+6
|
* Duplicate all fields of a blame hunkBen Straub2013-11-121-0/+5
|
* Blame: change signature to be more binding-friendlyBen Straub2013-11-051-1/+1
|
* Fix MSVC 64-bit warningsBen Straub2013-11-051-9/+9
|
* Adjust for diff API changesBen Straub2013-10-281-15/+8
|
* Move flag dependencies into docs and code.Ben Straub2013-10-101-0/+8
|
* Include signatures in blame hunksBen Straub2013-10-101-0/+4
|
* Clean up ported codeBen Straub2013-09-211-16/+8
|
* Simplify blob loading logicBen Straub2013-09-211-22/+17
|
* Clean up old methods, format long linesBen Straub2013-09-211-54/+71
| | | Added back the line index. We'll need it later.
* git_blame is a scoreboardBen Straub2013-09-211-18/+16
|
* Trim fat from git_blame structBen Straub2013-09-201-11/+0
|
* Add typedefs for internal structsBen Straub2013-09-201-7/+7
|
* Detect boundaries, support limiting commit rangeBen Straub2013-09-201-0/+1
|
* blame: allow restriction to line rangeBen Straub2013-09-191-0/+11
|
* Stop being crazy about freeing memoryBen Straub2013-09-191-26/+2
|
* Port blame from git.gitBen Straub2013-09-161-0/+492