diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-06-30 15:39:53 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-06-30 15:39:53 -0700 |
commit | 08585fd48d2d3d8facce9bdc366cfd896329a4b8 (patch) | |
tree | 731ec3979f6efde016abb6a06dcec0e184b640ea /xdiff/xutils.c | |
parent | d1314826935392d38e3bb2df754762a402d0af00 (diff) | |
parent | 36617af7ed594d1928554356d809bd611c642dd2 (diff) | |
download | git-08585fd48d2d3d8facce9bdc366cfd896329a4b8.tar.gz git-08585fd48d2d3d8facce9bdc366cfd896329a4b8.tar.xz |
Merge branch 'ap/diff-ignore-blank-lines'
"git diff" learned a mode that ignores hunks whose change consists
only of additions and removals of blank lines, which is the same as
"diff -B" (ignore blank lines) of GNU diff.
* ap/diff-ignore-blank-lines:
diff: add --ignore-blank-lines option
Diffstat (limited to 'xdiff/xutils.c')
-rw-r--r-- | xdiff/xutils.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/xdiff/xutils.c b/xdiff/xutils.c index 9504eaecb..62cb23dfd 100644 --- a/xdiff/xutils.c +++ b/xdiff/xutils.c @@ -143,6 +143,19 @@ long xdl_guess_lines(mmfile_t *mf, long sample) { return nl + 1; } +int xdl_blankline(const char *line, long size, long flags) +{ + long i; + + if (!(flags & XDF_WHITESPACE_FLAGS)) + return (size <= 1); + + for (i = 0; i < size && XDL_ISSPACE(line[i]); i++) + ; + + return (i == size); +} + int xdl_recmatch(const char *l1, long s1, const char *l2, long s2, long flags) { int i1, i2; |