Merge branch 'sg/rerere-gc-old-still-used'

* sg/rerere-gc-old-still-used:
  rerere: fix overeager gc
  mingw_utime(): handle NULL times parameter
This commit is contained in:
Junio C Hamano
2010-08-31 16:14:27 -07:00
4 changed files with 41 additions and 11 deletions

View File

@ -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;