summaryrefslogtreecommitdiff
path: root/src/checkout.c
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@microsoft.com>2015-11-23 15:49:54 -0500
committerEdward Thomson <ethomson@microsoft.com>2015-11-23 15:49:54 -0500
commit25e84f959ae77f21c32849aa98f274b9d8283f2d (patch)
treebc26699de31496ffdb1f3afa14e9bee35836915d /src/checkout.c
parent66e4e6da594653c461c4344e23738bad153320a1 (diff)
downloadlibgit2-25e84f959ae77f21c32849aa98f274b9d8283f2d.tar.gz
checkout: only consider nsecs when built that way
When examining the working directory and determining whether it's up-to-date, only consider the nanoseconds in the index entry when built with `GIT_USE_NSEC`. This prevents us from believing that the working directory is always dirty when the index was originally written with a git client that uinderstands nsecs (like git 2.x).
Diffstat (limited to 'src/checkout.c')
-rw-r--r--src/checkout.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/checkout.c b/src/checkout.c
index d09357f2a..a92ad0825 100644
--- a/src/checkout.c
+++ b/src/checkout.c
@@ -200,8 +200,7 @@ static bool checkout_is_workdir_modified(
* out.)
*/
if ((ie = git_index_get_bypath(data->index, wditem->path, 0)) != NULL) {
- if (wditem->mtime.seconds == ie->mtime.seconds &&
- wditem->mtime.nanoseconds == ie->mtime.nanoseconds &&
+ if (git_index_time_eq(&wditem->mtime, &ie->mtime) &&
wditem->file_size == ie->file_size)
return !is_workdir_base_or_new(&ie->id, baseitem, newitem);
}