diff options
author | Ben Straub <bs@github.com> | 2012-11-29 15:05:04 -0800 |
---|---|---|
committer | Ben Straub <bs@github.com> | 2012-11-30 13:12:14 -0800 |
commit | 2f8d30becb4801d869188d2d46ca1512843e8698 (patch) | |
tree | 603ee4d64529de316e1c83914705e83d46b38cad /src/diff.c | |
parent | 691776213947e59a3928aab09e97a64b65e990ab (diff) | |
download | libgit2-2f8d30becb4801d869188d2d46ca1512843e8698.tar.gz |
Deploy GIT_DIFF_OPTIONS_INIT
Diffstat (limited to 'src/diff.c')
-rw-r--r-- | src/diff.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/diff.c b/src/diff.c index 86f76f9c0..722acbead 100644 --- a/src/diff.c +++ b/src/diff.c @@ -755,14 +755,15 @@ fail: return error; } - #define DIFF_FROM_ITERATORS(MAKE_FIRST, MAKE_SECOND) do { \ git_iterator *a = NULL, *b = NULL; \ char *pfx = opts ? git_pathspec_prefix(&opts->pathspec) : NULL; \ - if (!(error = MAKE_FIRST) && !(error = MAKE_SECOND)) \ + if (!git_diff__opts_has_valid_version(opts)) \ + error = -1; \ + else if (!(error = MAKE_FIRST) && !(error = MAKE_SECOND)) \ error = diff_from_iterators(diff, repo, a, b, opts); \ git__free(pfx); git_iterator_free(a); git_iterator_free(b); \ - } while (0) +} while (0) int git_diff_tree_to_tree( git_diff_list **diff, |