Bug: duplicate sections in .git/config after remote removal

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

 



While the impact of this bug is minimal, and git itself is not
affected, it can affect external tools that want to read the
.git/config file, expecting unique section names.

To reproduce:

Given the following example .git/config file (I am leaving out the
[core] section for brevity):

    [remote "origin"]
        url = git@xxxxxxxxxx:Fryguy/example.git
        fetch = +refs/heads/*:refs/remotes/origin/*
    [branch "master"]
        remote = origin
        merge = refs/heads/master

Running `git remote rm origin` will result in the following contents:

    [branch "master"]

Running `git remote add origin git@xxxxxxxxxx:Fryguy/example.git` will
result in the following contents:

    [branch "master"]
    [remote "origin"]
        url = git@xxxxxxxxxx:Fryguy/example.git
        fetch = +refs/heads/*:refs/remotes/origin/*

And finally, running `git fetch origin; git branch -u origin/master`
will result in the following contents:

    [branch "master"]
    [remote "origin"]
        url = git@xxxxxxxxxx:Fryguy/example.git
        fetch = +refs/heads/*:refs/remotes/origin/*
    [branch "master"]
        remote = origin
        merge = refs/heads/master

at which point you can see the duplicate sections (even though one is
empty).  Also note that if you do the steps again, you will be left
with 3 sections, 2 of which are empty.  This process can be repeated
over and over.

Thanks,
Jason



[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