diff options
author | Junio C Hamano <gitster@pobox.com> | 2010-09-01 13:57:23 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-09-01 13:57:23 -0700 |
commit | c7f649a794250ca680569bd8c2466af42acb434a (patch) | |
tree | 25e2df69993bb180b1785cb2577cc2cc2ca62ca7 /compat | |
parent | Merge branch 'np/maint-huge-delta-generation' into maint (diff) | |
parent | rerere: fix overeager gc (diff) | |
download | tgif-c7f649a794250ca680569bd8c2466af42acb434a.tar.xz |
Merge branch 'sg/rerere-gc-old-still-used' into maint
* sg/rerere-gc-old-still-used:
rerere: fix overeager gc
mingw_utime(): handle NULL times parameter
Diffstat (limited to 'compat')
-rw-r--r-- | compat/mingw.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/compat/mingw.c b/compat/mingw.c index 96be8a02cf..f2d9e1fd97 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -304,8 +304,13 @@ int mingw_utime (const char *file_name, const struct utimbuf *times) goto revert_attrs; } - time_t_to_filetime(times->modtime, &mft); - time_t_to_filetime(times->actime, &aft); + if (times) { + time_t_to_filetime(times->modtime, &mft); + time_t_to_filetime(times->actime, &aft); + } else { + GetSystemTimeAsFileTime(&mft); + aft = mft; + } if (!SetFileTime((HANDLE)_get_osfhandle(fh), NULL, &aft, &mft)) { errno = EINVAL; rc = -1; |