Re: [PATCH v2 08/24] refs: convert read_ref and read_ref_full to object_id

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

> 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@xxxxxxxxxxxxxxxxxxxx>
> ---
>  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(-)
[...]
> --- 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@xxxxxxxxx>



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux