Re: [PATCH v2 08/24] refs: convert read_ref and read_ref_full to object_id
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Oct 10, 2017, 01:35 UTC
- Message-ID
- <20171010013550.GP19555@aiede.mtv.corp.google.com>
- In-Reply-To
- <20171009011132.675341-9-sandals@crustytoothpaste.net>
brian m. carlson wrote:
> All but two of the call sites already had parameters using the hash
nit: "already have", since commit messages use the present for the state of the codebase without the patch applied.
Show 26 quoted lines
> parameter of struct object_id, so convert them to take a pointer to the > struct directly. Also convert refs_read_refs_full, the underlying > implementation. > > Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> > --- > builtin/checkout.c | 6 +++--- > builtin/remote.c | 2 +- > builtin/replace.c | 4 ++-- > builtin/show-ref.c | 2 +- > builtin/tag.c | 4 ++-- > builtin/update-index.c | 6 +++--- > bundle.c | 2 +- > fast-import.c | 2 +- > notes-cache.c | 2 +- > notes-merge.c | 2 +- > notes-utils.c | 2 +- > notes.c | 2 +- > refs.c | 20 ++++++++++---------- > refs.h | 6 +++--- > refs/files-backend.c | 16 ++++++++-------- > remote-testsvn.c | 2 +- > remote.c | 6 +++--- > sequencer.c | 2 +- > transport-helper.c | 5 ++--- > 19 files changed, 46 insertions(+), 47 deletions(-)
[...]
Show 8 quoted lines
> --- a/builtin/checkout.c
> +++ b/builtin/checkout.c
> @@ -379,7 +379,7 @@ static int checkout_paths(const struct checkout_opts *opts,
> if (write_locked_index(&the_index, lock_file, COMMIT_LOCK))
> die(_("unable to write new index file"));
>
> - read_ref_full("HEAD", 0, rev.hash, NULL);
> + read_ref_full("HEAD", 0, &rev, NULL);Yep, this is nicer (and likewise for the rest of them).
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>