diff options
author | Ben Straub <bstraub@github.com> | 2012-05-15 15:41:05 -0700 |
---|---|---|
committer | Ben Straub <bstraub@github.com> | 2012-05-15 15:41:05 -0700 |
commit | 1ce4cc0164fbc14fcb7f686483aa581bc946bfdb (patch) | |
tree | 628f63f6508247275eac89357b8b1b960d68f23b /src/revparse.c | |
parent | 7c22e72ba65fa4ac9c2989d115435aa60788136c (diff) | |
download | libgit2-1ce4cc0164fbc14fcb7f686483aa581bc946bfdb.tar.gz |
Fix date.c build in msvc.
Ported the win32 implementations of gmtime_r,
localtime_r, and gettimeofday to be part of the
posix compatibility layer, and fixed
git_signature_now to use them.
Diffstat (limited to 'src/revparse.c')
-rw-r--r-- | src/revparse.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/revparse.c b/src/revparse.c index 3487f5638..8eb5c11ae 100644 --- a/src/revparse.c +++ b/src/revparse.c @@ -199,10 +199,12 @@ static int walk_ref_history(git_object **out, git_repository *repo, const char * git_reference_free(ref); } } else { + int date_error = 0; + time_t timestamp; git_buf datebuf = GIT_BUF_INIT; + git_buf_put(&datebuf, reflogspec+2, reflogspeclen-3); - int date_error = 0; - time_t timestamp = approxidate_careful(git_buf_cstr(&datebuf), &date_error); + timestamp = approxidate_careful(git_buf_cstr(&datebuf), &date_error); /* @{u} or @{upstream} -> upstream branch, for a tracking branch. This is stored in the config. */ if (!strcmp(reflogspec, "@{u}") || !strcmp(reflogspec, "@{upstream}")) { @@ -267,8 +269,10 @@ static int walk_ref_history(git_object **out, git_repository *repo, const char * /* TODO: clunky. Factor "now" into a utility */ git_signature *sig; + git_time as_of; + git_signature_now(&sig, "blah", "blah"); - git_time as_of = sig->when; + as_of = sig->when; git_signature_free(sig); as_of.time = (timestamp > 0) |