Re: [PATCH v2] rerere: fix overeager gc
- From
Johannes Sixt <j.sixt@viscovery.net>
- Date
- Jul 1, 2010, 10:10 UTC
- Message-ID
- <4C2C69AF.4010303@viscovery.net>
- In-Reply-To
- <1277977009-22780-1-git-send-email-szeder@ira.uka.de>
Am 7/1/2010 11:36, schrieb SZEDER Gábor:
> -static time_t rerere_created_at(const char *name) > +static time_t rerere_last_checked_at(const char *name)
rerere_last_used_at?
Show 12 quoted lines
> @@ -378,7 +378,13 @@ static int merge(const char *name, const char *path)
> }
> ret = ll_merge(&result, path, &base, NULL, &cur, "", &other, "", 0);
> if (!ret) {
> - FILE *f = fopen(path, "w");
> + FILE *f;
> +
> + if (utime(rerere_path(name, "preimage"), NULL) < 0)
> + warning("failed utime() on %s: %s",
> + rerere_path(name, "preimage"),
> + strerror(errno));
> + f = fopen(path, "w");I think this should be outside of 'if (!ret)' condition because even if the merge fails, the resolution was *used*.
Mental note: update mingw_utime to accept NULL for the second parameter...
-- Hannes