Re: [PATCH 04/24] refs: convert update_ref and refs_update_ref to use struct object_id
- From
Stefan Beller <sbeller@google.com>
- Date
- Oct 2, 2017, 22:37 UTC
- Message-ID
- <CAGZ79kaY36mo2bpohO8cknPShOBbZt_tpi_kjoxLHE=cFJ3ROw@mail.gmail.com>
- In-Reply-To
- <20171001220831.214705-5-sandals@crustytoothpaste.net>
Show 11 quoted lines
> diff --git a/bisect.c b/bisect.c > index 96beeb5d13..e8470a2e0f 100644 > --- a/bisect.c > +++ b/bisect.c > @@ -685,11 +685,13 @@ static int bisect_checkout(const struct object_id *bisect_rev, int no_checkout) > char bisect_rev_hex[GIT_MAX_HEXSZ + 1]; > > memcpy(bisect_rev_hex, oid_to_hex(bisect_rev), GIT_SHA1_HEXSZ + 1); > - update_ref(NULL, "BISECT_EXPECTED_REV", bisect_rev->hash, NULL, 0, UPDATE_REFS_DIE_ON_ERR); > + update_ref(NULL, "BISECT_EXPECTED_REV", bisect_rev, NULL, 0, > + UPDATE_REFS_DIE_ON_ERR);
The number of characters decrease, yet the line gets an additional line break. While I don't mind this, the most interesting question that comes to mind is whether you tried the new clang formatting options in tree to adapt the indentation? ;)
Show 15 quoted lines
> --- a/builtin/reset.c
> +++ b/builtin/reset.c
> @@ -266,12 +266,12 @@ static int reset_refs(const char *rev, const struct object_id *oid)
> if (!get_oid("HEAD", &oid_orig)) {
> orig = &oid_orig;
> set_reflog_message(&msg, "updating ORIG_HEAD", NULL);
> - update_ref_oid(msg.buf, "ORIG_HEAD", orig, old_orig, 0,
> + update_ref(msg.buf, "ORIG_HEAD", orig, old_orig, 0,
> UPDATE_REFS_MSG_ON_ERR);
> } else if (old_orig)
> delete_ref(NULL, "ORIG_HEAD", old_orig, 0);
> set_reflog_message(&msg, "updating HEAD", rev);
> - update_ref_status = update_ref_oid(msg.buf, "HEAD", oid, orig, 0,
> + update_ref_status = update_ref(msg.buf, "HEAD", oid, orig, 0,
> UPDATE_REFS_MSG_ON_ERR);At all the other places (of s/update_ref_oid/update_ref/) so far you re-indented the second line to align. This doesn't align in the first place, so it shall be good.