Re: [PATCH 3/6] tree-walk.c: remove the_repo from get_tree_entry()

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

 



On Mon, Jun 24, 2019 at 9:20 PM Derrick Stolee <stolee@xxxxxxxxx> wrote:
>
> On 6/24/2019 5:55 AM, Nguyễn Thái Ngọc Duy wrote:
> > Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@xxxxxxxxx>
> > ---
> >  archive.c              |  4 +++-
> >  blame.c                |  4 ++--
> >  builtin/rm.c           |  2 +-
> >  builtin/update-index.c |  2 +-
> >  line-log.c             |  7 ++++---
> >  match-trees.c          |  6 +++---
> >  merge-recursive.c      |  8 +++++---
> >  notes.c                |  2 +-
> >  sha1-name.c            |  9 +++++----
> >  tree-walk.c            | 18 ++++++++++++------
> >  tree-walk.h            |  2 +-
> >  11 files changed, 38 insertions(+), 26 deletions(-)
> >
> > diff --git a/archive.c b/archive.c
> > index 53141c1f0e..a8da0fcc4f 100644
> > --- a/archive.c
> > +++ b/archive.c
> > @@ -418,7 +418,9 @@ static void parse_treeish_arg(const char **argv,
> >               unsigned short mode;
> >               int err;
> >
> > -             err = get_tree_entry(&tree->object.oid, prefix, &tree_oid,
> > +             err = get_tree_entry(ar_args->repo,
>
> If I'm reading this correctly, this is a place where we previously converted
> to using a custom repository pointer but this function boundary reverted us
> to the_repository anyway. I know we have some tests around the commit-graph
> that ensures it works with an arbitrary repository (and I frequently stumble
> over them when I add new dependencies). How can we add more testing around
> these new conversions?

Right now it's really patchy. There's no guarantee that the_repo is
not used somwhere in the callchain (or will not be in the future). My
main aim is _not_ break it when used with the_repo. These new
conversions hopefully will get more used outside the default the_repo
setting (e.g. new developments in git-submodule, or git-worktree).
Eventually the_repo should be gone (or referenced in very few places),
then the conversion will get more coverage. Really mixing repos though
will not be as well tested until actually used (by submodule and
friends).
-- 
Duy




[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