diff options
author | Edward Thomson <ethomson@github.com> | 2022-02-11 17:56:05 -0500 |
---|---|---|
committer | Edward Thomson <ethomson@edwardthomson.com> | 2022-02-12 06:59:09 -0500 |
commit | 359240b674ad809c4986596bfe8a6837ee386e13 (patch) | |
tree | 958884656f0bbba594ebada294b37dea3da9ce44 /include | |
parent | e86e81c5d97aa6879b0e7850f734c606cbbd2a90 (diff) | |
download | libgit2-359240b674ad809c4986596bfe8a6837ee386e13.tar.gz |
diff: indicate when the file size is "valid"
When we know the file size (because we're producing it from a working
directory iterator, or an index with an up-to-date cache) then set a
flag indicating as such. This removes the ambiguity about a 0 file
size, which could indicate that a file exists and is 0 bytes, or that we
haven't read it yet.
Diffstat (limited to 'include')
-rw-r--r-- | include/git2/diff.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/git2/diff.h b/include/git2/diff.h index 9424ffd06..3839f0033 100644 --- a/include/git2/diff.h +++ b/include/git2/diff.h @@ -207,7 +207,8 @@ typedef enum { GIT_DIFF_FLAG_BINARY = (1u << 0), /**< file(s) treated as binary data */ GIT_DIFF_FLAG_NOT_BINARY = (1u << 1), /**< file(s) treated as text data */ GIT_DIFF_FLAG_VALID_ID = (1u << 2), /**< `id` value is known correct */ - GIT_DIFF_FLAG_EXISTS = (1u << 3) /**< file exists at this side of the delta */ + GIT_DIFF_FLAG_EXISTS = (1u << 3), /**< file exists at this side of the delta */ + GIT_DIFF_FLAG_VALID_SIZE = (1u << 4) /**< file size value is known correct */ } git_diff_flag_t; /** |