summaryrefslogtreecommitdiff
path: root/include/git2/diff.h
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-05-07 04:32:17 -0700
committerRussell Belfer <rb@github.com>2013-05-07 04:32:17 -0700
commite35e2684f693f28afb7a8f28028b4cb8bdd19f49 (patch)
tree95b1a7c9a41145a6495535cdc1f8b840d241dca0 /include/git2/diff.h
parent3405f78754703948475b4677d03fcdbfb099b6a4 (diff)
downloadlibgit2-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 'include/git2/diff.h')
-rw-r--r--include/git2/diff.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/git2/diff.h b/include/git2/diff.h
index 0ef47c018..e10b65f7b 100644
--- a/include/git2/diff.h
+++ b/include/git2/diff.h
@@ -356,8 +356,10 @@ typedef enum {
GIT_DIFF_LINE_CONTEXT = ' ',
GIT_DIFF_LINE_ADDITION = '+',
GIT_DIFF_LINE_DELETION = '-',
- GIT_DIFF_LINE_ADD_EOFNL = '\n', /**< Removed line w/o LF & added one with */
- GIT_DIFF_LINE_DEL_EOFNL = '\0', /**< LF was removed at end of file */
+
+ GIT_DIFF_LINE_CONTEXT_EOFNL = '=', /**< Both files have no LF at end */
+ GIT_DIFF_LINE_ADD_EOFNL = '>', /**< Old has no LF at end, new does */
+ GIT_DIFF_LINE_DEL_EOFNL = '<', /**< Old has LF at end, new does not */
/* The following values will only be sent to a `git_diff_data_cb` when
* the content of a diff is being formatted (eg. through