Add support for logAllRefUpdates configuration parameter

Honor the configuration parameter core.logAllRefUpdates when writing
reflogs.  Instead of writing reflog entries always only write
reflogs if this parameter is set to true or if the corresponding
file in the <git-dir>/logs directory already exists. In other words:
if you are updating a ref and this parameter is set to false and
there is no file corresponding to your ref in the <git-dir>/logs
folder then no reflog will be written.

This is a fix for the issue

Change-Id: I908e4c77e3630dc3223b2d2a47cb4534dbe4ed42
Signed-off-by: Matthias Sohn <>
Signed-off-by: Christian Halstrick <>
Signed-off-by: Shawn O. Pearce <>
4 files changed