From: Junio C Hamano Date: Tue, 31 Aug 2010 23:14:27 +0000 (-0700) Subject: Merge branch 'sg/rerere-gc-old-still-used' X-Git-Tag: v1.7.3-rc0~37 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e24058f57f4e76e38e20390c5927590f3cd48085;p=git.git Merge branch 'sg/rerere-gc-old-still-used' * sg/rerere-gc-old-still-used: rerere: fix overeager gc mingw_utime(): handle NULL times parameter --- e24058f57f4e76e38e20390c5927590f3cd48085 diff --cc builtin/rerere.c index 9b1e3a7cf,6d1b5802a..67793fa2c --- a/builtin/rerere.c +++ b/builtin/rerere.c @@@ -53,13 -59,18 +59,18 @@@ static void garbage_collect(struct stri while ((e = readdir(dir))) { if (is_dot_or_dotdot(e->d_name)) continue; - then = rerere_created_at(e->d_name); - if (!then) - continue; - cutoff = (has_rerere_resolution(e->d_name) - ? cutoff_resolve : cutoff_noresolve); + + then = rerere_last_used_at(e->d_name); + if (then) { + cutoff = cutoff_resolve; + } else { + then = rerere_created_at(e->d_name); + if (!then) + continue; + cutoff = cutoff_noresolve; + } if (then < now - cutoff * 86400) - string_list_append(e->d_name, &to_remove); + string_list_append(&to_remove, e->d_name); } for (i = 0; i < to_remove.nr; i++) unlink_rr_item(to_remove.items[i].string);