src/blame.c


Log

Author Commit Date CI Message
Patrick Steinhardt f17ed637 2016-03-10T16:42:55 blame: handle error when resoling HEAD in normalize_options 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`.
Patrick Steinhardt cb1cb24c 2015-11-24T10:18:58 blame: use size_t for line counts in git_blame_hunk 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.
Edward Thomson ae195a71 2015-09-29T12:46:41 blame: guard xdiff calls for large files
Edward Thomson 8147b1af 2015-05-25T20:03:59 diff: introduce binary diff callbacks 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.
Edward Thomson 392702ee 2015-02-09T23:41:13 allocations: test for overflow of requested size Introduce some helper macros to test integer overflow from arithmetic and set error message appropriately.
Arkady Shapkin 5cd81bb3 2014-09-03T01:01:25 Several CppCat warnings fixed
Russell Belfer 702efc89 2014-04-30T10:57:42 Make init_options fns use unsigned ints and macro 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).
Jiri Pospisil 79aa0302 2014-03-06T22:23:57 blame: Fix compare function's data types 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).
Matthew Bowen b9f81997 2014-03-05T21:49:23 Added function-based initializers for every options struct. The basic structure of each function is courtesy of arrbee.
Russell Belfer e9d5e5f3 2014-01-28T16:25:42 Some fixes for Windows x64 warnings
Arthur Schreiber 29be3a6d 2014-01-14T21:33:35 Align git_signature_dup. 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.
Arthur Schreiber b0b32b43 2014-01-13T22:51:10 Fix a double free issue in `git_blame__alloc`. `git_blame_free` already calls `git__free` on `gbr`.
XTao a06474f8 2014-01-08T11:19:12 Add orig_commit.
Russell Belfer 9cfce273 2013-12-12T12:11:38 Cleanups, renames, and leak fixes 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.
Russell Belfer fcd324c6 2013-12-06T15:04:31 Add git_vector_free_all 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.
Russell Belfer 96869a4e 2013-12-03T16:45:39 Improve GIT_EUSER handling 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.
Paul Holden 8f460f2c 2013-12-05T20:41:12 blame.c: Remove unnecessary error-check and goto In private function 'load_blob'.
Ben Straub b20c40a8 2013-11-12T19:02:28 Don't leak memory when duplicating a NULL signature
Ben Straub 9db56cc4 2013-11-12T18:57:16 Fix buffer blame with new lines at end of file
Ben Straub 089297b2 2013-11-12T15:24:59 Duplicate all fields of a blame hunk
Ben Straub 8adea28a 2013-11-05T11:42:42 Blame: change signature to be more binding-friendly
Ben Straub aad5403f 2013-11-05T10:55:54 Fix MSVC 64-bit warnings
Ben Straub 7dcb1c45 2013-10-28T11:21:23 Adjust for diff API changes
Ben Straub 364d800b 2013-10-10T14:53:07 Move flag dependencies into docs and code.
Ben Straub c1ca2b67 2013-10-10T14:30:05 Include signatures in blame hunks
Ben Straub b6f60a4d 2013-09-21T22:02:23 Clean up ported code
Ben Straub 77db6ff5 2013-09-21T22:01:53 Simplify blob loading logic
Ben Straub f0c9d8ba 2013-09-21T21:19:33 Clean up old methods, format long lines Added back the line index. We'll need it later.
Ben Straub 0a0f0558 2013-09-20T15:51:22 git_blame is a scoreboard
Ben Straub ef03d040 2013-09-20T15:38:15 Trim fat from git_blame struct
Ben Straub a121e580 2013-09-20T15:20:03 Add typedefs for internal structs
Ben Straub 25c47aae 2013-09-20T14:31:51 Detect boundaries, support limiting commit range
Ben Straub d1228f1c 2013-09-19T14:18:51 blame: allow restriction to line range
Ben Straub 3e0cf2a1 2013-09-19T10:27:37 Stop being crazy about freeing memory
Ben Straub ceab4e26 2013-09-16T16:20:38 Port blame from git.git