builtin-reflog.c: don't install new reflog on write failure
commit7a0a34ca6f31c6bb5d24ccc0cdab606736d7a322
authorBrandon Casey <casey@nrlssc.navy.mil>
Fri, 22 Feb 2008 18:47:08 +0000 (22 12:47 -0600)
committerJunio C Hamano <gitster@pobox.com>
Wed, 27 Feb 2008 21:26:24 +0000 (27 13:26 -0800)
treec4c82fd80edf4e489a8a1720ff2df5083539c627
parent6ecbc851fb30f540e1a25761f221aab963cfe619
builtin-reflog.c: don't install new reflog on write failure

When expiring reflog entries, a new temporary log is written which contains
only the entries to retain. After it is written, it is renamed to replace
the existing reflog. Currently, we check that writing of the new log is
successful and print a message on failure, but the original reflog is still
replaced with the new reflog even on failure. This patch causes the
original reflog to be retained if we fail when writing the new reflog.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-reflog.c