diff options
author | Axel Rasmussen <axelrasmussen@google.com> | 2015-08-29 13:59:20 -0700 |
---|---|---|
committer | Axel Rasmussen <axelrasmussen@google.com> | 2015-09-18 23:33:56 -0700 |
commit | 0226f7dd36c990e9bc1632adbc655fefc797513a (patch) | |
tree | 7077e9792dc75e9b7d74813914e2fe08010a8d0d /src/diff.c | |
parent | 360dd4dafd30bced1dab1d516765e347d09b91ba (diff) | |
download | libgit2-0226f7dd36c990e9bc1632adbc655fefc797513a.tar.gz |
diff/index: respect USE_NSEC for racily clean file detection
Diffstat (limited to 'src/diff.c')
-rw-r--r-- | src/diff.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/diff.c b/src/diff.c index b2259c74d..f8e0c53d3 100644 --- a/src/diff.c +++ b/src/diff.c @@ -131,7 +131,7 @@ static int diff_delta__from_one( if (status == GIT_DELTA_UNTRACKED && DIFF_FLAG_ISNT_SET(diff, GIT_DIFF_INCLUDE_UNTRACKED)) return 0; - + if (status == GIT_DELTA_UNREADABLE && DIFF_FLAG_ISNT_SET(diff, GIT_DIFF_INCLUDE_UNREADABLE)) return 0; @@ -864,7 +864,10 @@ static int maybe_modified( oitem->ino != nitem->ino || oitem->uid != nitem->uid || oitem->gid != nitem->gid || - (index && nitem->mtime.seconds >= index->stamp.mtime)) + (index && + ((nitem->mtime.seconds > (int32_t) index->stamp.mtime.tv_sec) || + ((nitem->mtime.seconds == (int32_t) index->stamp.mtime.tv_sec) && + (nitem->mtime.nanoseconds >= (uint32_t) index->stamp.mtime.tv_nsec))))) { status = GIT_DELTA_MODIFIED; modified_uncertain = true; |