diff options
| author | Ben Straub <bs@github.com> | 2013-09-25 14:47:32 -0700 |
|---|---|---|
| committer | Ben Straub <bs@github.com> | 2013-09-25 14:47:32 -0700 |
| commit | 41dd999d12946ca2085ad315e9c5e8e57cc4e4f6 (patch) | |
| tree | 0f9b3f7beefa40809a913e1e215b75dfe5a87115 /src/diff.c | |
| parent | f7db1b6f26837b44a5cb8956c23bbbdff28ba4f7 (diff) | |
| parent | ac316e743878908df762cc0ea07a71cbee5c5802 (diff) | |
| download | libgit2-41dd999d12946ca2085ad315e9c5e8e57cc4e4f6.tar.gz | |
Merge branch 'development' into blame
Diffstat (limited to 'src/diff.c')
| -rw-r--r-- | src/diff.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/diff.c b/src/diff.c index 77dbbd8bc..39facce60 100644 --- a/src/diff.c +++ b/src/diff.c @@ -440,7 +440,8 @@ static int diff_list_apply_options( /* If not given explicit `opts`, check `diff.xyz` configs */ if (!opts) { - diff->opts.context_lines = config_int(cfg, "diff.context", 3); + int context = config_int(cfg, "diff.context", 3); + diff->opts.context_lines = context >= 0 ? (uint16_t)context : 3; /* add other defaults here */ } @@ -568,21 +569,21 @@ int git_diff__oid_for_file( giterr_set(GITERR_OS, "File size overflow (for 32-bits) on '%s'", path); result = -1; } else { - git_vector filters = GIT_VECTOR_INIT; + git_filter_list *fl = NULL; - result = git_filters_load(&filters, repo, path, GIT_FILTER_TO_ODB); - if (result >= 0) { + result = git_filter_list_load(&fl, repo, NULL, path, GIT_FILTER_TO_ODB); + if (!result) { int fd = git_futils_open_ro(full_path.ptr); if (fd < 0) result = fd; else { result = git_odb__hashfd_filtered( - oid, fd, (size_t)size, GIT_OBJ_BLOB, &filters); + oid, fd, (size_t)size, GIT_OBJ_BLOB, fl); p_close(fd); } - } - git_filters_free(&filters); + git_filter_list_free(fl); + } } cleanup: |
