Commit 341608dcd47f1c36ed8cb00e84d3e150bdda70fb

Edward Thomson 2018-01-31T14:48:42

Merge pull request #4507 from tomas/patch-1 Honor 'GIT_USE_NSEC' option in `filesystem_iterator_set_current`

diff --git a/src/iterator.c b/src/iterator.c
index 132b2c7..ff075ce 100644
--- a/src/iterator.c
+++ b/src/iterator.c
@@ -1458,10 +1458,15 @@ static void filesystem_iterator_set_current(
 	filesystem_iterator_entry *entry)
 {
 	iter->entry.ctime.seconds = entry->st.st_ctime;
-	iter->entry.ctime.nanoseconds = entry->st.st_ctime_nsec;
-
 	iter->entry.mtime.seconds = entry->st.st_mtime;
+
+#if defined(GIT_USE_NSEC)	
+	iter->entry.ctime.nanoseconds = entry->st.st_ctime_nsec;
 	iter->entry.mtime.nanoseconds = entry->st.st_mtime_nsec;
+#else
+	iter->entry.ctime.nanoseconds = 0;
+	iter->entry.mtime.nanoseconds = 0;
+#endif
 
 	iter->entry.dev = entry->st.st_dev;
 	iter->entry.ino = entry->st.st_ino;