diff options
author | Russell Belfer <rb@github.com> | 2013-05-07 04:32:17 -0700 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2013-05-07 04:32:17 -0700 |
commit | e35e2684f693f28afb7a8f28028b4cb8bdd19f49 (patch) | |
tree | 95b1a7c9a41145a6495535cdc1f8b840d241dca0 /tests-clar/diff/diff_helpers.c | |
parent | 3405f78754703948475b4677d03fcdbfb099b6a4 (diff) | |
download | libgit2-e35e2684f693f28afb7a8f28028b4cb8bdd19f49.tar.gz |
Add GIT_DIFF_LINE_CONTEXT_EOFNL
This adds a new line origin constant for the special line that
is used when both files end without a newline.
In the course of writing the tests for this, I was having problems
with modifying a file but not having diff notice because it was
the same size and modified less than one second from the start of
the test, so I decided to start working on nanosecond timestamp
support. This commit doesn't contain the nanosecond support, but
it contains the reorganization of maybe_modified and the hooks so
that if the nanosecond data were being read by stat() (or rather
being copied by git_index_entry__init_from_stat), then the nsec
would be taken into account.
This new stuff could probably use some more tests, although there
is some amount of it here.
Diffstat (limited to 'tests-clar/diff/diff_helpers.c')
-rw-r--r-- | tests-clar/diff/diff_helpers.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/tests-clar/diff/diff_helpers.c b/tests-clar/diff/diff_helpers.c index e7f97c034..75eda0520 100644 --- a/tests-clar/diff/diff_helpers.c +++ b/tests-clar/diff/diff_helpers.c @@ -97,20 +97,15 @@ int diff_line_cb( e->lines++; switch (line_origin) { case GIT_DIFF_LINE_CONTEXT: + case GIT_DIFF_LINE_CONTEXT_EOFNL: /* techically not a line */ e->line_ctxt++; break; case GIT_DIFF_LINE_ADDITION: - e->line_adds++; - break; - case GIT_DIFF_LINE_ADD_EOFNL: - /* technically not a line add, but we'll count it as such */ + case GIT_DIFF_LINE_ADD_EOFNL: /* technically not a line add */ e->line_adds++; break; case GIT_DIFF_LINE_DELETION: - e->line_dels++; - break; - case GIT_DIFF_LINE_DEL_EOFNL: - /* technically not a line delete, but we'll count it as such */ + case GIT_DIFF_LINE_DEL_EOFNL: /* technically not a line delete */ e->line_dels++; break; default: |