From a346992f7e7812416651eb5c2b52129adec5eacf Mon Sep 17 00:00:00 2001 From: Ben Straub Date: Thu, 10 May 2012 09:47:14 -0700 Subject: Rev-parse: @{time} syntax. Ported date.c (for approxidate_careful) from git.git revision aa39b85. Trimmed out the parts we're not using. --- src/util.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/util.h') diff --git a/src/util.h b/src/util.h index 2081f29f9..4d1ee680d 100644 --- a/src/util.h +++ b/src/util.h @@ -209,4 +209,11 @@ GIT_INLINE(bool) git__isspace(int c) return (c == ' ' || c == '\t' || c == '\n' || c == '\f' || c == '\r' || c == '\v'); } +GIT_INLINE(int) git__time_cmp(const git_time *a, const git_time *b) +{ + /* Adjust for time zones. Times are in seconds, offsets are in minutes. */ + git_time_t adjusted_a = a->time + ((b->offset - a->offset) * 60); + return adjusted_a - b->time; +} + #endif /* INCLUDE_util_h__ */ -- cgit v1.2.3