Re: [PATCH] remote: rename also remotes in the branch.<name>.pushRemote config
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Jan 17, 2020, 09:49 UTC
- Message-ID
- <nycvar.QRO.7.76.6.2001171046460.46@tvgsbejvaqbjf.bet>
- In-Reply-To
- <xmqq7e1rf0zg.fsf@gitster-ct.c.googlers.com>
Hi Junio,
On Thu, 16 Jan 2020, Junio C Hamano wrote:
Show 32 quoted lines
> Bert Wesarg <bert.wesarg@googlemail.com> 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