Re: [PATCH] remote: rename also remotes in the branch.<name>.pushRemote config

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

 



Hi Junio,

On Thu, 16 Jan 2020, Junio C Hamano wrote:

> Bert Wesarg <bert.wesarg@xxxxxxxxxxxxxx> writes:
>
> > diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh
> > index 883b32efa0..59a1681636 100755
> > --- a/t/t5505-remote.sh
> > +++ b/t/t5505-remote.sh
> > @@ -737,12 +737,14 @@ test_expect_success 'rename a remote' '
> >  	git clone one four &&
> >  	(
> >  		cd four &&
> > +		git config branch.master.pushRemote origin &&
> >  		git remote rename origin upstream &&
> >  		test -z "$(git for-each-ref refs/remotes/origin)" &&
> >  		test "$(git symbolic-ref refs/remotes/upstream/HEAD)" = "refs/remotes/upstream/master" &&
> >  		test "$(git rev-parse upstream/master)" = "$(git rev-parse master)" &&
> >  		test "$(git config remote.upstream.fetch)" = "+refs/heads/*:refs/remotes/upstream/*" &&
> > -		test "$(git config branch.master.remote)" = "upstream"
> > +		test "$(git config branch.master.remote)" = "upstream" &&
> > +		test "$(git config branch.master.pushRemote)" = "upstream"
> >  	)
> >  '
>
> OK, so the issue the patch wants to address is
>
> 	git remote rename X Y
>
> ought to rename branch.X.Z (for any value of Z) to branch.Y.Z but it
> forgot to do so for Z==pushRemote?
>
> If that is the case, I have to wonder if the patch is making the
> situation better or even worse.  Shouldn't we be not even caring
> what Z is by not having to list these specific keys?  I dunno.

I think what the code does is not rename branch.X.Z to branch.Y.Z, but for
every `branch.B.pushRemote` whose value is `X`, it will now be set to `Y`.

So we really should not touch, say, `branch.X.description` because it has
nothing to do with any renamed remote.

And yes, I agree, the commit message would have made for a splendid place
to explain something like this.

Ciao,
Dscho




[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