aboutsummaryrefslogtreecommitdiff
path: root/git-compat-util.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-03-17 18:54:31 -0700
committerJunio C Hamano <gitster@pobox.com>2009-03-17 18:54:31 -0700
commita9bfe813094cf2c8ea0e30c3196070c868fb294c (patch)
tree143c940f6059792b1ccb044db31e82206bd1477c /git-compat-util.h
parent642d0844b9795ca7b1424f4afc8d8c86abd7bf34 (diff)
parent381b920b8ac1440962f340cba9030e2dc3130c49 (diff)
downloadgit-a9bfe813094cf2c8ea0e30c3196070c868fb294c.tar.gz
git-a9bfe813094cf2c8ea0e30c3196070c868fb294c.tar.xz
Merge branch 'kb/checkout-optim'
* kb/checkout-optim: Revert "lstat_cache(): print a warning if doing ping-pong between cache types" checkout bugfix: use stat.mtime instead of stat.ctime in two places Makefile: Set compiler switch for USE_NSEC Create USE_ST_TIMESPEC and turn it on for Darwin Not all systems use st_[cm]tim field for ns resolution file timestamp Record ns-timestamps if possible, but do not use it without USE_NSEC write_index(): update index_state->timestamp after flushing to disk verify_uptodate(): add ce_uptodate(ce) test make USE_NSEC work as expected fix compile error when USE_NSEC is defined check_updates(): effective removal of cache entries marked CE_REMOVE lstat_cache(): print a warning if doing ping-pong between cache types show_patch_diff(): remove a call to fstat() write_entry(): use fstat() instead of lstat() when file is open write_entry(): cleanup of some duplicated code create_directories(): remove some memcpy() and strchr() calls unlink_entry(): introduce schedule_dir_for_removal() lstat_cache(): swap func(length, string) into func(string, length) lstat_cache(): generalise longest_match_lstat_cache() lstat_cache(): small cleanup and optimisation
Diffstat (limited to 'git-compat-util.h')
-rw-r--r--git-compat-util.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/git-compat-util.h b/git-compat-util.h
index 878d83dd0..19062534a 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -388,4 +388,18 @@ void git_qsort(void *base, size_t nmemb, size_t size,
# define FORCE_DIR_SET_GID 0
#endif
+#ifdef NO_NSEC
+#undef USE_NSEC
+#define ST_CTIME_NSEC(st) 0
+#define ST_MTIME_NSEC(st) 0
+#else
+#ifdef USE_ST_TIMESPEC
+#define ST_CTIME_NSEC(st) ((unsigned int)((st).st_ctimespec.tv_nsec))
+#define ST_MTIME_NSEC(st) ((unsigned int)((st).st_mtimespec.tv_nsec))
+#else
+#define ST_CTIME_NSEC(st) ((unsigned int)((st).st_ctim.tv_nsec))
+#define ST_MTIME_NSEC(st) ((unsigned int)((st).st_mtim.tv_nsec))
+#endif
+#endif
+
#endif