| 771 | } |
| 772 | |
| 773 | func TestRemoteURLs(t *testing.T) { |
| 774 | repo := test.NewRepo(t) |
| 775 | repo.Pushd() |
| 776 | defer func() { |
| 777 | repo.Popd() |
| 778 | repo.Cleanup() |
| 779 | }() |
| 780 | cfg := repo.GitConfig() |
| 781 | cfg.SetLocal("remote.foo.url", "https://github.com/git-lfs/git-lfs.git") |
| 782 | cfg.SetLocal("remote.bar.url", "https://github.com/git-lfs/wildmatch.git") |
| 783 | cfg.SetLocal("remote.bar.pushurl", "https://github.com/git-lfs/pktline.git") |
| 784 | |
| 785 | expected := make(map[string][]string) |
| 786 | expected["foo"] = []string{"https://github.com/git-lfs/git-lfs.git"} |
| 787 | expected["bar"] = []string{"https://github.com/git-lfs/wildmatch.git"} |
| 788 | actual, err := RemoteURLs(false) |
| 789 | assert.Nil(t, err) |
| 790 | assert.Equal(t, expected, actual) |
| 791 | |
| 792 | expected["bar"] = []string{"https://github.com/git-lfs/pktline.git"} |
| 793 | actual, err = RemoteURLs(true) |
| 794 | assert.Nil(t, err) |
| 795 | assert.Equal(t, expected, actual) |
| 796 | } |
| 797 | |
| 798 | func TestMapRemoteURL(t *testing.T) { |
| 799 | repo := test.NewRepo(t) |