diff options
| author | Carl Schwan <carl@carlschwan.eu> | 2020-01-29 02:00:04 +0100 |
|---|---|---|
| committer | Carl Schwan <carl@carlschwan.eu> | 2020-04-14 15:50:53 +0200 |
| commit | 9830ab3d2572abec3cee46015aaf4e618132da5b (patch) | |
| tree | ad148b8ca107f9bba73d15ce8fc3ae64cc8b4984 /src | |
| parent | 918a7d19553a9a4181bf1561b8b828a5f82e60e0 (diff) | |
| download | libgit2-9830ab3d2572abec3cee46015aaf4e618132da5b.tar.gz | |
blame: add option to ignore whitespace changes
Diffstat (limited to 'src')
| -rw-r--r-- | src/blame_git.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/blame_git.c b/src/blame_git.c index a9157c4ed..073137a68 100644 --- a/src/blame_git.c +++ b/src/blame_git.c @@ -365,11 +365,14 @@ static void trim_common_tail(mmfile_t *a, mmfile_t *b, long ctx) b->size -= trimmed - recovered; } -static int diff_hunks(mmfile_t file_a, mmfile_t file_b, void *cb_data) +static int diff_hunks(mmfile_t file_a, mmfile_t file_b, void *cb_data, git_blame_options *options) { - xpparam_t xpp = {0}; xdemitconf_t xecfg = {0}; xdemitcb_t ecb = {0}; + xpparam_t xpp = {0}; + + if (options->flags & GIT_BLAME_IGNORE_WHITESPACE) + xpp.flags |= XDF_IGNORE_WHITESPACE; xecfg.hunk_func = my_emit; ecb.priv = cb_data; @@ -409,7 +412,7 @@ static int pass_blame_to_parent( fill_origin_blob(parent, &file_p); fill_origin_blob(target, &file_o); - if (diff_hunks(file_p, file_o, &d) < 0) + if (diff_hunks(file_p, file_o, &d, &blame->options) < 0) return -1; /* The reset (i.e. anything after tlno) are the same as the parent */ |
