Minor bug in git branch --set-upstream-to adding superfluous branch section to config
- From
- Phil Haack <haacked@gmail.com>
- Date
- Mar 29, 2013, 16:29 UTC
- Message-ID
- <CAD7mMPW=jr6PaAc50h-Wpf42-UPrn0A5KmisqXNXqqLv78AEgg@mail.gmail.com>
Hello there! Please /cc me with responses as I'm not on the mailing list.
I'm using git version 1.8.1.msysgit.1 and I ran into a very minor issue. It doesn't actually seem to affect operations, but I thought I'd report it in case someone felt it was worth cleaning up.
If you run the following set of commands:
git checkout -b some-branch
git push origin some-branch
git branch --set-upstream-to origin/some-branch
git branch --unset-upstream some-branch
git branch --set-upstream-to origin/some-branchYou get the following result in the .git\config file
[branch "some-branch"]
[branch "some-branch"]
remote = origin
merge = refs/heads/some-branchMy expectation is that the very last call to: git branch --set-upstream-to would not add a new config section, but would instead insert this information into the existing [branch "some-branch"].
In any case, from what I understand the current behavior is technically valid and I haven't encountered any adverse effects. It was just something I noticed while testing.
Thanks!