log_ref_setup(): separate code for create vs non-create
commit854bda6b4f7d6bc6087966bfa74a59c232eceac6
authorMichael Haggerty <mhagger@alum.mit.edu>
Fri, 6 Jan 2017 16:22:32 +0000 (6 17:22 +0100)
committerJunio C Hamano <gitster@pobox.com>
Sun, 8 Jan 2017 03:30:09 +0000 (7 19:30 -0800)
tree61c5f99232baeeae7146e1e3144aa7f9a4090182
parent81b1b6d4ff5dea059c2120819f5cffcd915dff2e
log_ref_setup(): separate code for create vs non-create

The behavior of this function (especially how it handles errors) is
quite different depending on whether we are willing to create the reflog
vs. whether we are only trying to open an existing reflog. So separate
the code paths.

This also simplifies the next steps.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs/files-backend.c