From: Junio C Hamano <gitster@pobox.com>
To: Ronnie Sahlberg <sahlberg@google.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 05/12] refs.c: pass NULL as *flags to read_ref_full
Date: Fri, 18 Jul 2014 15:31:20 -0700 [thread overview]
Message-ID: <xmqqd2d2l2o7.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <1405549392-27306-6-git-send-email-sahlberg@google.com> (Ronnie Sahlberg's message of "Wed, 16 Jul 2014 15:23:05 -0700")
Ronnie Sahlberg <sahlberg@google.com> writes:
> We call read_ref_full with a pointer to flags from rename_ref but since
> we never actually use the returned flags we can just pass NULL here instead.
Sensible, at least for the current callers. I had to wonder if
rename_ref() would never want to take advantage of the flags return
parameter in the future, though. For example, would it want to act
differently when the given ref turns out to be a symref? Would it
want to report something when the ref to be overwritten was a broken
one?
> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
> Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
> ---
> refs.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/refs.c b/refs.c
> index 7d65253..0df6894 100644
> --- a/refs.c
> +++ b/refs.c
> @@ -2666,7 +2666,7 @@ int rename_ref(const char *oldrefname, const char *newrefname, const char *logms
> goto rollback;
> }
>
> - if (!read_ref_full(newrefname, sha1, 1, &flag) &&
> + if (!read_ref_full(newrefname, sha1, 1, NULL) &&
> delete_ref(newrefname, sha1, REF_NODEREF)) {
> if (errno==EISDIR) {
> if (remove_empty_directories(git_path("%s", newrefname))) {
next prev parent reply other threads:[~2014-07-18 22:31 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-16 22:23 [PATCH 00/12] Use ref transactions part 3 Ronnie Sahlberg
2014-07-16 22:23 ` [PATCH 01/12] wrapper.c: simplify warn_if_unremovable Ronnie Sahlberg
2014-07-18 22:21 ` Junio C Hamano
2014-07-16 22:23 ` [PATCH 02/12] wrapper.c: add a new function unlink_or_msg Ronnie Sahlberg
2014-07-18 22:25 ` Junio C Hamano
2014-07-18 22:59 ` Junio C Hamano
2014-07-22 17:42 ` Ronnie Sahlberg
2014-07-22 17:56 ` Junio C Hamano
2014-07-16 22:23 ` [PATCH 03/12] refs.c: add an err argument to delete_ref_loose Ronnie Sahlberg
2014-07-16 22:23 ` [PATCH 04/12] refs.c: pass the ref log message to _create/delete/update instead of _commit Ronnie Sahlberg
2014-07-16 22:23 ` [PATCH 05/12] refs.c: pass NULL as *flags to read_ref_full Ronnie Sahlberg
2014-07-18 22:31 ` Junio C Hamano [this message]
2014-07-22 18:19 ` Ronnie Sahlberg
2014-07-22 21:44 ` Ronnie Sahlberg
2014-07-16 22:23 ` [PATCH 06/12] refs.c: move the check for valid refname to lock_ref_sha1_basic Ronnie Sahlberg
2014-07-18 22:37 ` Junio C Hamano
2014-07-16 22:23 ` [PATCH 07/12] refs.c: call lock_ref_sha1_basic directly from commit Ronnie Sahlberg
2014-07-16 22:23 ` [PATCH 08/12] refs.c: pass a skip list to name_conflict_fn Ronnie Sahlberg
2014-07-16 22:23 ` [PATCH 09/12] refs.c: propagate any errno==ENOTDIR from _commit back to the callers Ronnie Sahlberg
2014-07-16 22:23 ` [PATCH 10/12] fetch.c: change s_update_ref to use a ref transaction Ronnie Sahlberg
2014-07-16 22:23 ` [PATCH 11/12] refs.c: make write_ref_sha1 static Ronnie Sahlberg
2014-07-16 22:23 ` [PATCH 12/12] refs.c: fix handling of badly named refs Ronnie Sahlberg
2014-07-22 20:41 ` Junio C Hamano
2014-07-22 21:30 ` Ronnie Sahlberg
2014-07-22 21:36 ` Ronnie Sahlberg
2014-07-22 21:46 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqd2d2l2o7.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=sahlberg@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.