diff options
author | Pierre-Olivier Latour <pol@mac.com> | 2014-10-26 10:40:46 -0700 |
---|---|---|
committer | Pierre-Olivier Latour <pol@mac.com> | 2014-10-27 09:17:01 -0700 |
commit | d88766c4e16c311ba8ce28e71a6545c5d0d7521f (patch) | |
tree | 4f328df9927cfd707311e58105be0a433a15a85a | |
parent | 116a19d4674237af7a8ff1e1822e3033e1f8f0d7 (diff) | |
download | libgit2-d88766c4e16c311ba8ce28e71a6545c5d0d7521f.tar.gz |
Changed context_lines and interhunk_lines to uint32_t to match struct s_xdemitconf
-rw-r--r-- | CHANGELOG.md | 5 | ||||
-rw-r--r-- | include/git2/diff.h | 4 | ||||
-rw-r--r-- | src/diff.c | 2 |
3 files changed, 8 insertions, 3 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ccd2c485..786668c4a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -107,3 +107,8 @@ v0.21 + 1 * The THREADSAFE option to build libgit2 with threading support has been flipped to be on by default. + +* The context_lines and interhunk_lines fields in git_diff_options are + now uint32_t instead of uint16_t. This allows to set them to UINT_MAX, + in effect asking for "infinite" context e.g. to iterate over all the + unmodified lines of a diff. diff --git a/include/git2/diff.h b/include/git2/diff.h index 1013b5c33..4403944f4 100644 --- a/include/git2/diff.h +++ b/include/git2/diff.h @@ -377,8 +377,8 @@ typedef struct { /* options controlling how to diff text is generated */ - uint16_t context_lines; /**< defaults to 3 */ - uint16_t interhunk_lines; /**< defaults to 0 */ + uint32_t context_lines; /**< defaults to 3 */ + uint32_t interhunk_lines; /**< defaults to 0 */ uint16_t id_abbrev; /**< default 'core.abbrev' or 7 if unset */ git_off_t max_size; /**< defaults to 512MB */ const char *old_prefix; /**< defaults to "a" */ diff --git a/src/diff.c b/src/diff.c index 2691d7ca0..375d4cb13 100644 --- a/src/diff.c +++ b/src/diff.c @@ -439,7 +439,7 @@ static int diff_list_apply_options( /* If not given explicit `opts`, check `diff.xyz` configs */ if (!opts) { int context = git_config__get_int_force(cfg, "diff.context", 3); - diff->opts.context_lines = context >= 0 ? (uint16_t)context : 3; + diff->opts.context_lines = context >= 0 ? (uint32_t)context : 3; /* add other defaults here */ } |